Skip to content

Commit 7218c6e

Browse files
author
Andrew Anguiano
authored
Merge pull request #2457 from newrelic/andrew/NR-283000-actions-branch-protections
Remove `generate-schema` and branch protection actions
2 parents 78e8e5e + 01e6f18 commit 7218c6e

File tree

5 files changed

+2
-363
lines changed

5 files changed

+2
-363
lines changed

.github/workflows/pr-merged.yml

+1-115
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,12 @@ jobs:
3030
fetch-depth: 0
3131

3232
- name: Setup workspace
33-
uses: './.github/actions/bootstrap'
33+
uses: "./.github/actions/bootstrap"
3434

3535
- name: Generate UUIDs for quickstarts
3636
id: generate-uuids
3737
run: cd utils && yarn generate-uuids
3838

39-
- name: Temporarily disable branch protections
40-
id: disable-branch-protection
41-
if: always()
42-
uses: actions/github-script@v6
43-
with:
44-
github-token: ${{ secrets.OPENSOURCE_BOT_TOKEN }}
45-
script: |
46-
const result = await github.rest.repos.updateBranchProtection({
47-
owner: context.repo.owner,
48-
repo: context.repo.repo,
49-
branch: 'release',
50-
required_status_checks: null,
51-
restrictions: null,
52-
enforce_admins: null,
53-
required_pull_request_reviews: null
54-
})
55-
console.log("Result:", result)
56-
5739
- name: Commit changes
5840
id: commit-changes
5941
run: |
@@ -69,99 +51,3 @@ jobs:
6951
- name: Push Commit
7052
if: env.commit == 'true'
7153
run: git push origin HEAD
72-
73-
- name: Re-enable branch protections
74-
id: enable-branch-protection
75-
if: always()
76-
uses: actions/github-script@v6
77-
with:
78-
github-token: ${{ secrets.OPENSOURCE_BOT_TOKEN }}
79-
script: |
80-
const result = await github.rest.repos.updateBranchProtection({
81-
owner: context.repo.owner,
82-
repo: context.repo.repo,
83-
branch: 'release',
84-
required_status_checks: {
85-
strict: true,
86-
contexts: [
87-
'Validation / Image count and extension compliance',
88-
'Validation / Ensure icons exist',
89-
'Validation / Install plan ids exist',
90-
'Validation / Data source ids exist',
91-
'Validation / Install plan schema compliance',
92-
'Validation / Data source schema compliance',
93-
'Validation / Quickstart id are unique',
94-
'Validation / Validate Quickstart Schema',
95-
'Validation / Quickstart dashboard name is unique'
96-
]
97-
},
98-
restrictions: {
99-
"users":[],
100-
"teams":[],
101-
"apps":[]
102-
},
103-
enforce_admins: true,
104-
required_pull_request_reviews: {
105-
dismiss_stale_reviews: true,
106-
required_approving_review_count: 1,
107-
dismissal_restrictions: {
108-
users: [],
109-
teams: []
110-
}
111-
}
112-
})
113-
console.log("Result:", result)
114-
115-
# get-pr-number:
116-
# name: Get PR number
117-
# runs-on: ubuntu-latest
118-
# outputs:
119-
# pr-number: ${{ steps.output_pr_number.outputs.pr-number }}
120-
# steps:
121-
# - name: Download artifact
122-
# uses: dawidd6/action-download-artifact@v2
123-
# with:
124-
# workflow: submit_gate.yml
125-
# run_id: ${{ github.event.workflow_run.id }}
126-
127-
# - name: Get PR number
128-
# id: output_pr_number
129-
# run: |
130-
# export PR_NUMBER=$(cat artifact/pr_number_submit.txt)
131-
# echo "pr-number=$PR_NUMBER" >> $GITHUB_OUTPUT
132-
133-
# staging:
134-
# needs: [generate-uuid, get-pr-number]
135-
# uses: ./.github/workflows/reusable.quickstart_submission.yml
136-
# with:
137-
# pr-number: ${{ needs.get-pr-number.outputs.pr-number }}
138-
# dry-run: false
139-
# secrets:
140-
# nr-api-url: ${{ secrets.NR_API_URL_STAGING }}
141-
# nr-api-token: ${{ secrets.NR_API_TOKEN_STAGING }}
142-
# github-token: ${{ secrets.GITHUB_TOKEN }}
143-
# nr-license-key: ${{ secrets.NEW_RELIC_LICENSE_KEY }}
144-
145-
# production:
146-
# needs: [staging, get-pr-number]
147-
# uses: ./.github/workflows/reusable.quickstart_submission.yml
148-
# with:
149-
# pr-number: ${{ needs.get-pr-number.outputs.pr-number }}
150-
# dry-run: false
151-
# secrets:
152-
# nr-api-url: ${{ secrets.NR_API_URL }}
153-
# nr-api-token: ${{ secrets.NR_API_TOKEN }}
154-
# github-token: ${{ secrets.GITHUB_TOKEN }}
155-
# nr-license-key: ${{ secrets.NEW_RELIC_LICENSE_KEY }}
156-
157-
# eu-production:
158-
# needs: [staging, get-pr-number]
159-
# uses: ./.github/workflows/reusable.quickstart_submission.yml
160-
# with:
161-
# pr-number: ${{ needs.get-pr-number.outputs.pr-number }}
162-
# dry-run: false
163-
# secrets:
164-
# nr-api-url: ${{ secrets.NR_API_URL_EU }}
165-
# nr-api-token: ${{ secrets.NR_API_TOKEN_EU }}
166-
# github-token: ${{ secrets.GITHUB_TOKEN }}
167-
# nr-license-key: ${{ secrets.NEW_RELIC_LICENSE_KEY }}

.github/workflows/release.yml

+1-95
Original file line numberDiff line numberDiff line change
@@ -10,100 +10,6 @@ env:
1010
THIRD_PARTY_GIT_AUTHOR_NAME: nr-opensource-bot
1111

1212
jobs:
13-
generate-schema-docs:
14-
name: Generate GraphQL schema documentation
15-
runs-on: ubuntu-latest
16-
steps:
17-
- name: Checkout repository
18-
uses: actions/checkout@v3
19-
with:
20-
token: ${{ secrets.OPENSOURCE_BOT_TOKEN }}
21-
ref: "main"
22-
fetch-depth: 0
23-
24-
- name: Setup workspace
25-
uses: './.github/actions/bootstrap'
26-
27-
- name: Generate schema docs for GraphQl
28-
id: generate-schema
29-
env:
30-
NR_API_URL: ${{ secrets.NR_API_URL }}
31-
NR_API_TOKEN: ${{ secrets.NR_API_TOKEN }}
32-
run: cd utils && yarn generate-schema-docs
33-
34-
- name: Commit changes
35-
id: commit-changes
36-
run: |
37-
git config --local user.email "${{ env.THIRD_PARTY_GIT_AUTHOR_EMAIL }}"
38-
git config --local user.name "${{ env.THIRD_PARTY_GIT_AUTHOR_NAME }}"
39-
git add ./docs/*
40-
git diff-index --quiet HEAD ./docs/* || git commit -m 'chore: generate schema documentation [skip ci]'
41-
echo "commit=true" >> $GITHUB_ENV
42-
43-
- name: Temporarily disable branch protections
44-
id: disable-branch-protection
45-
if: always()
46-
uses: actions/github-script@v6
47-
with:
48-
github-token: ${{ secrets.OPENSOURCE_BOT_TOKEN }}
49-
script: |
50-
const result = await github.rest.repos.updateBranchProtection({
51-
owner: context.repo.owner,
52-
repo: context.repo.repo,
53-
branch: 'main',
54-
required_status_checks: null,
55-
restrictions: null,
56-
enforce_admins: null,
57-
required_pull_request_reviews: null
58-
})
59-
console.log("Result:", result)
60-
61-
- name: Push Commit
62-
if: env.commit == 'true'
63-
run: git push origin HEAD
64-
65-
- name: Re-enable branch protections
66-
id: enable-branch-protection
67-
if: always()
68-
uses: actions/github-script@v6
69-
with:
70-
github-token: ${{ secrets.OPENSOURCE_BOT_TOKEN }}
71-
script: |
72-
const result = await github.rest.repos.updateBranchProtection({
73-
owner: context.repo.owner,
74-
repo: context.repo.repo,
75-
branch: 'main',
76-
required_status_checks: {
77-
strict: true,
78-
contexts: [
79-
'Validation / Image count and extension compliance',
80-
'Validation / Ensure icons exist',
81-
'Validation / Install plan ids exist',
82-
'Validation / Data source ids exist',
83-
'Validation / Install plan schema compliance',
84-
'Validation / Data source schema compliance',
85-
'Validation / Quickstart id are unique',
86-
'Validation / Validate Quickstart Schema',
87-
'Validation / Quickstart dashboard name is unique'
88-
]
89-
},
90-
restrictions: {
91-
"users":[],
92-
"teams":[],
93-
"apps":[]
94-
},
95-
enforce_admins: true,
96-
required_pull_request_reviews: {
97-
dismiss_stale_reviews: true,
98-
required_approving_review_count: 1,
99-
dismissal_restrictions: {
100-
users: [],
101-
teams: []
102-
}
103-
}
104-
})
105-
console.log("Result:", result)
106-
10713
generate-third-party-notices:
10814
runs-on: ubuntu-latest
10915
steps:
@@ -115,7 +21,7 @@ jobs:
11521
fetch-depth: 2
11622

11723
- name: Setup workspace
118-
uses: './.github/actions/bootstrap'
24+
uses: "./.github/actions/bootstrap"
11925

12026
- name: Install OSS CLI
12127
working-directory: ./utils

utils/graphql-schemas/constants.js

-82
This file was deleted.

utils/graphql-schemas/generate-schema-docs.js

-70
This file was deleted.

0 commit comments

Comments
 (0)