-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #807 from newrelic/jerel/fix-related-pages-commits
Commit changes to related content on the main branch
- Loading branch information
Showing
1 changed file
with
6 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,8 @@ jobs: | |
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: main | ||
|
||
- name: Setup node.js | ||
uses: actions/setup-node@v1 | ||
|
@@ -47,50 +49,12 @@ jobs: | |
git commit -m 'chore(related-content): updated related content data' | ||
echo "::set-output name=commit::true" | ||
- name: Temporarily disable "required_pull_request_reviews" branch protection | ||
id: disable-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: null, | ||
restrictions: null, | ||
enforce_admins: null, | ||
required_pull_request_reviews: null | ||
}) | ||
console.log("Result:", result) | ||
# Push directly to `main` branch because we want updates to the related | ||
# content to trigger a deploy. If we commit directly to the `develop` | ||
# branch, it would require a PR from the team to deploy the changes. | ||
- name: Push Commit | ||
if: steps.commit-changes.outputs.commit == 'true' | ||
uses: ad-m/[email protected] | ||
with: | ||
github_token: ${{ secrets.OPENSOURCE_BOT_TOKEN }} | ||
branch: develop | ||
|
||
- name: Re-enable "required_pull_request_reviews" 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: null, | ||
restrictions: null, | ||
enforce_admins: true, | ||
required_pull_request_reviews: { | ||
dismiss_stale_reviews: true, | ||
required_approving_review_count: 1 | ||
} | ||
}) | ||
console.log("Result:", result) | ||
branch: main |