Skip to content

Commit e9ebd9f

Browse files
authored
Fix CI workflows (#60) (#61)
* ci: Update Git user to dedicated CI account Replace a personal GitHub account with the dedicated CI account for Git operations in GitHub Actions. This ensures commits and tags created during CI runs are properly attributed to the CI system. * ci: Switch secret for `DEVELOCITY_ACCESS_KEY` The secret in this repo is named `DEVELOCITY_ACCESS_KEY`. * ci: Fix release-notes.yml Error: Data doesn't contain `nodes` field.
1 parent 4885f06 commit e9ebd9f

File tree

3 files changed

+16
-44
lines changed

3 files changed

+16
-44
lines changed

.github/workflows/gradle.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ on:
77
branches:
88
- '[4-9]+.[0-9]+.x'
99
env:
10-
GIT_USER_NAME: grails-build
11-
GIT_USER_EMAIL: grails-build@users.noreply.github.com
10+
GIT_USER_NAME: ${{ secrets.GIT_USER_NAME }}
11+
GIT_USER_EMAIL: ${{ secrets.GIT_USER_EMAIL }}
1212

1313
jobs:
1414

@@ -48,7 +48,7 @@ jobs:
4848

4949
- name: Build Project
5050
env:
51-
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCEESS_KEY }}
51+
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
5252
run: ./gradlew build
5353

5454
- name: Publish Snapshot version to Artifactory (repo.grails.org)

.github/workflows/release-notes.yml

+11-39
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,23 @@
1-
name: Changelog
1+
name: "Release Drafter"
22
on:
33
issues:
4-
types: [closed,reopened]
4+
types: [closed, reopened]
55
push:
66
branches:
7+
- master
78
- '[4-9]+.[0-9]+.x'
89
pull_request:
9-
types: [opened, reopened, synchronize, labeled]
10+
types: [opened, reopened, synchronize]
1011
pull_request_target:
11-
types: [opened, reopened, synchronize, labeled]
12+
types: [opened, reopened, synchronize]
1213
workflow_dispatch:
1314
jobs:
14-
release_notes:
15+
update_release_draft:
16+
permissions:
17+
contents: read # limit to read access
1518
runs-on: ubuntu-latest
1619
steps:
17-
- uses: actions/checkout@v3
18-
- name: Check if it has release drafter config file
19-
id: check_release_drafter
20-
run: |
21-
has_release_drafter=$([ -f .github/release-drafter.yml ] && echo "true" || echo "false")
22-
echo "has_release_drafter=${has_release_drafter}" >> $GITHUB_OUTPUT
23-
- name: Extract branch name
24-
id: extract_branch
25-
run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
26-
# If it has release drafter:
27-
- uses: release-drafter/release-drafter@v5
28-
if: steps.check_release_drafter.outputs.has_release_drafter == 'true'
20+
- name: "📝 Update Release Draft"
21+
uses: release-drafter/release-drafter@v6
2922
env:
30-
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
31-
with:
32-
commitish: ${{ steps.extract_branch.outputs.value }}
33-
# Otherwise:
34-
- name: Export Gradle Properties
35-
if: steps.check_release_drafter.outputs.has_release_drafter == 'false'
36-
uses: micronaut-projects/github-actions/export-gradle-properties@master
37-
- uses: micronaut-projects/github-actions/release-notes@master
38-
if: steps.check_release_drafter.outputs.has_release_drafter == 'false'
39-
id: release_notes
40-
with:
41-
token: ${{ secrets.GH_TOKEN }}
42-
- uses: ncipollo/release-action@v1
43-
if: steps.check_release_drafter.outputs.has_release_drafter == 'false' && steps.release_notes.outputs.generated_changelog == 'true'
44-
with:
45-
allowUpdates: true
46-
commit: ${{ steps.release_notes.outputs.current_branch }}
47-
draft: true
48-
name: "${{ env.title }} ${{ steps.release_notes.outputs.next_version }}"
49-
tag: v${{ steps.release_notes.outputs.next_version }}
50-
bodyFile: CHANGELOG.md
51-
token: ${{ secrets.GH_TOKEN }}
23+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

.github/workflows/release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ on:
33
release:
44
types: [published]
55
env:
6-
GIT_USER_NAME: puneetbehl
7-
GIT_USER_EMAIL: behlp@unityfoundation.io
6+
GIT_USER_NAME: ${{ secrets.GIT_USER_NAME }}
7+
GIT_USER_EMAIL: ${{ secrets.GIT_USER_EMAIL }}
88

99
jobs:
1010
release:

0 commit comments

Comments
 (0)