Skip to content

Commit

Permalink
chore: Use release branch for whats new ID commits
Browse files Browse the repository at this point in the history
  • Loading branch information
LizBaker committed Feb 3, 2022
1 parent a36fc85 commit 8cd5c1f
Showing 1 changed file with 3 additions and 57 deletions.
60 changes: 3 additions & 57 deletions .github/workflows/update-whats-new-ids.yml
Expand Up @@ -19,8 +19,7 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v2
with:
ref: develop
persist-credentials: false
fetch-depth: '0'

- name: Setup node.js
uses: actions/setup-node@v1
Expand All @@ -41,64 +40,11 @@ jobs:
git add ./src/data/whats-new-ids.json
git diff-index --quiet HEAD ./src/data/whats-new-ids.json || git commit -m 'chore(whats-new-ids): updated ids'
echo "::set-output name=commit::true"
- name: Temporarily disable branch protection
id: disable-branch-protection
uses: actions/github-script@v1
with:
github-token: ${{ secrets.OPENSOURCE_BOT_TOKEN }}
previews: luke-cage-preview
script: |
const result = await github.repos.updateBranchProtection({
owner: context.repo.owner,
repo: context.repo.repo,
branch: 'develop',
required_status_checks: null,
restrictions: null,
enforce_admins: null,
required_pull_request_reviews: null
})
console.log("Result:", result)
# Push directly to the `develop` branch so we get the changes included in the release PR
# Push directly to the release branch so we get the changes included in the release PR

- name: Push Commit
if: steps.commit-changes.outputs.commit == 'true'
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.OPENSOURCE_BOT_TOKEN }}
branch: develop

- name: Re-enable branch protection
id: enable-branch-protection
if: always()
uses: actions/github-script@v1
with:
github-token: ${{ secrets.OPENSOURCE_BOT_TOKEN }}
previews: luke-cage-preview
script: |
const result = await github.repos.updateBranchProtection({
owner: context.repo.owner,
repo: context.repo.repo,
branch: 'develop',
required_status_checks: {
strict: false,
contexts: [
'Gatsby Build Service - docs-website-develop',
'run linter',
'run tests',
'license/cla',
'unpaired translations removed'
]
},
restrictions: {
users: [],
teams: ['developer-enablement']
},
enforce_admins: null,
required_pull_request_reviews: {
dismiss_stale_reviews: true,
required_approving_review_count: 1
}
})
console.log("Result:", result)
branch: ${{ github.event.pull_request.head.ref }}

0 comments on commit 8cd5c1f

Please sign in to comment.