Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use release branch for whats new ID commits #5948

Merged
merged 2 commits into from
Feb 4, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
60 changes: 3 additions & 57 deletions .github/workflows/update-whats-new-ids.yml
Original file line number Diff line number Diff line change
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
roadlittledawn marked this conversation as resolved.
Show resolved Hide resolved
# 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 }}