Skip to content

Commit

Permalink
Gh-2960: Git user shows as invalid for commits made by GitHub Actions (
Browse files Browse the repository at this point in the history
…#2961)

* Set credentials to be GitHub Actions Bot

* Remove redundent step from Koryphe action and improve PR details

* Remove redundent step from release and use of Admin token when not required

* Upgrade Action versions
  • Loading branch information
GCHQDeveloper314 authored May 22, 2023
1 parent 18d34fe commit 2b8247b
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
fetch-depth: 0

- name: Setup JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/create-hotfix-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: Checkout master
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: master
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
Expand Down Expand Up @@ -65,8 +65,8 @@ jobs:

- name: Set up Github credentials
run: |
git config user.name Gaffer
git config user.email github-actions@github.com
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Update versions
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/create-release-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: Checkout develop
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: develop
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
Expand Down Expand Up @@ -65,8 +65,8 @@ jobs:

- name: Set up Github credentials
run: |
git config user.name Gaffer
git config user.email github-actions@github.com
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Update versions
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-standalone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Setup JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8'

- name: Checkout Branch
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Decode CodeSigning key
env:
Expand Down
40 changes: 15 additions & 25 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,21 @@ jobs:

steps:
- name: Setup JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8'

- name: Checkout master
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: master
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
fetch-depth: 0

- name: Set up Github credentials
run: |
git config user.name Gaffer
git config user.email github-actions@github.com
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Set release version
run: echo "RELEASE_VERSION=$(echo ${{ github.event.milestone.title }} | cut -c 2-)" >> $GITHUB_ENV
Expand All @@ -50,13 +49,6 @@ jobs:
if: ${{ !env.BRANCH_NAME }}
run: exit 1

- name: Checkout master
uses: actions/checkout@v2
with:
ref: master
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
fetch-depth: 0

- name: Merge release into master
run: |
git checkout ${{ env.BRANCH_NAME }}
Expand All @@ -76,19 +68,18 @@ jobs:

steps:
- name: Checkout develop
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: develop
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
fetch-depth: 0

- name: Set up Github credentials
run: |
git config user.name Gaffer
git config user.email github-actions@github.com
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Setup JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8'
Expand All @@ -115,7 +106,7 @@ jobs:

steps:
- name: Checkout Master
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: master

Expand Down Expand Up @@ -143,18 +134,17 @@ jobs:

steps:
- name: Checkout Master
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: master
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}

- name: Set up Github credentials
run: |
git config user.name Gaffer
git config user.email github-actions@github.com
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Setup JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
Expand Down Expand Up @@ -185,13 +175,13 @@ jobs:

steps:
- name: Setup JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8'

- name: Checkout release
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ needs.create-release-tag.outputs.branch_name }}

Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/update-koryphe-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,17 @@ jobs:

steps:
- name: Checkout branch
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}

- name: Get branch name
run: echo "SOURCE_BRANCH=$(git branch --show-current)" >> $GITHUB_ENV

- name: Set up Github credentials
run: |
git config user.name Gaffer
git config user.email github-actions@github.com
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Setup JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8'
Expand All @@ -43,3 +40,5 @@ jobs:
source_branch: ${{ env.VERSION_UPDATE_BRANCH }}
destination_branch: ${{ env.SOURCE_BRANCH }}
github_token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
pr_title: "Update Koryphe version to ${{ github.event.inputs.version }}"
pr_body: "Automated GitHub Actions PR to upgrade to version ${{ github.event.inputs.version }} of Koryphe"

0 comments on commit 2b8247b

Please sign in to comment.