Skip to content

Commit

Permalink
Merge pull request #807 from newrelic/jerel/fix-related-pages-commits
Browse files Browse the repository at this point in the history
Commit changes to related content on the main branch
  • Loading branch information
jerelmiller authored Oct 2, 2020
2 parents 6e040e1 + bbcb709 commit 3f615ab
Showing 1 changed file with 6 additions and 42 deletions.
48 changes: 6 additions & 42 deletions .github/workflows/fetch-related-content.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 3f615ab

Please sign in to comment.