-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ithub/workflows/test.yaml - Updating workflow test to use the GH APP credentials modified: README.md - Modifying instructions and information needed for github and what permissions are needed for the github App
- Loading branch information
1 parent
3b0add2
commit 60aae35
Showing
3 changed files
with
56 additions
and
26 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 |
---|---|---|
|
@@ -12,13 +12,23 @@ jobs: | |
runs-on: [ubuntu-latest] | ||
outputs: | ||
matrix: ${{ steps.list.outputs.value }} | ||
token: ${{ steps.automerge_token.outputs.token }} | ||
steps: | ||
- name: 'Generate GitHub App Token' | ||
id: automerge_token | ||
uses: actions/[email protected] | ||
with: | ||
app-id: ${{ secrets.AUTOMERGE_APP_ID }} | ||
private-key: ${{ secrets.AUTOMERGE_APP_PRIVATE_KEY }} | ||
owner: ${{ github.repository_owner }} | ||
- name: 'Check out devops repo' | ||
env: | ||
token: ${{ steps.automerge_token.outputs.token }} | ||
uses: actions/[email protected] | ||
- id: list | ||
name: 'List automerge repos' | ||
run: echo "value=$(cat test/automerge.json | tr -d '\n')" >> $GITHUB_OUTPUT | ||
|
||
automerge-test: | ||
name: 'Automerge' | ||
runs-on: [ubuntu-latest] | ||
|
@@ -28,7 +38,17 @@ jobs: | |
matrix: | ||
value: ${{fromJson(needs.list.outputs.matrix)}} | ||
steps: | ||
- name: 'Generate GitHub App Token' | ||
id: automerge_token | ||
uses: actions/[email protected] | ||
with: | ||
app-id: ${{ secrets.AUTOMERGE_APP_ID }} | ||
private-key: ${{ secrets.AUTOMERGE_APP_PRIVATE_KEY }} | ||
owner: ${{ github.repository_owner }} | ||
|
||
- name: 'Check Automerge Repo to Test' | ||
env: | ||
token: ${{ steps.automerge_token.outputs.token }} | ||
uses: actions/checkout@v4 | ||
|
||
- name: 'Automerge runtimeverification/${{ matrix.value }}' | ||
|
@@ -37,7 +57,7 @@ jobs: | |
with: | ||
org: 'runtimeverification' | ||
repo: ${{ matrix.value }} | ||
token: ${{ secrets.JENKINS_GITHUB_PAT }} | ||
token: ${{ steps.automerge_token.outputs.token }} | ||
debug: --dry-run | ||
|
||
- name: 'Automerge runtimeverification/${{ matrix.value }}' | ||
|
@@ -46,7 +66,7 @@ jobs: | |
with: | ||
org: 'runtimeverification' | ||
repo: ${{ matrix.value }} | ||
token: ${{ secrets.JENKINS_GITHUB_PAT }} | ||
token: ${{ steps.automerge_token.outputs.token }} | ||
debug: --dry-run | ||
comment: 'true' | ||
|
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,17 @@ Any PR with the following criteria will be updated and test will be run before m | |
- PR is passing PR Tests | ||
- PR is out-of-date | ||
|
||
A Github App is required to generate the appropriate Permissions for Automerge to work. | ||
- The Github App is not public and requires each org to generate their own. | ||
Adding a token generation step to their automerge workflow. See Example Workflow below. | ||
- Specific repositories can be granted access using the app instead of ALL repositories under the org. | ||
|
||
Github App Permissions: | ||
- Content Read/Write -- For Updating PRs | ||
- Pull Request Read/Write -- For Updating PRs | ||
- Repository Administration Read -- For read access to repositories under the Org. | ||
- Checks Read -- For reading the check statuses of the PR | ||
|
||
## Table of Contents | ||
- [Automerge PR Action](#automerge-pr-action) | ||
- [Table of Contents](#table-of-contents) | ||
|
@@ -62,7 +73,13 @@ jobs: | |
- id: list | ||
name: 'List automerge repos' | ||
run: echo "value=$(cat test/automerge.json | tr -d '\n')" >> $GITHUB_OUTPUT | ||
|
||
- name: 'Generate GitHub App Token' | ||
id: automerge_token | ||
uses: actions/[email protected] | ||
with: | ||
app_id: ${{ secrets.AUTOMERGE_APP_ID }} | ||
private_key: ${{ secrets.AUTOMERGE_APP_PRIVATE_KEY }} | ||
|
||
automerge-test: | ||
name: 'Automerge' | ||
runs-on: [ubuntu-latest] | ||
|
@@ -73,7 +90,7 @@ jobs: | |
value: ${{fromJson(needs.list.outputs.matrix)}} | ||
steps: | ||
- name: 'Automerge runtimeverification/${{ matrix.value }}' | ||
uses: ./ # This uses the action in the root directory | ||
uses: runtimeverification/[email protected] # This uses the action in the root directory | ||
with: | ||
org: 'runtimeverification' # As long as the token you use has access, any org is valid here | ||
repo: ${{ matrix.value }} | ||
|
@@ -112,8 +129,9 @@ Checkout the repository you wish to run automerge on to a local directory. | |
git clone [email protected]:org/automerge.git | ||
cd automerge | ||
``` | ||
|
||
Now you need to run the command from this new directory | ||
Setup `GITHUB_TOKEN` with the appropriate permissions: Content Read/Write, Pull Request Read/Write, Adminstration Read, Checks Read. | ||
Now you need to run the command from this new directory. | ||
RV setup a test repository with Pull Requests in Known States to validate the action is working as expected. | ||
```bash | ||
$(pwd)/../src/automerge.py --org runtimeverification --repo automerger-test --dry-run | ||
``` | ||
|
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