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 all commits
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
33 changes: 9 additions & 24 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,7 +40,6 @@ 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
Expand All @@ -52,22 +50,21 @@ jobs:
const result = await github.repos.updateBranchProtection({
owner: context.repo.owner,
repo: context.repo.repo,
branch: 'develop',
branch: context.payload.pull_request.head.ref,
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 current 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
branch: ${{ github.head_ref }}

- name: Re-enable branch protection
id: enable-branch-protection
Expand All @@ -80,25 +77,13 @@ jobs:
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,
branch: context.payload.pull_request.head.ref,
enforce_admins: true,
required_status_checks: null,
restrictions: null,
required_pull_request_reviews: {
dismiss_stale_reviews: true,
required_approving_review_count: 1
}
})
console.log("Result:", result)
console.log("Result:", result)