Skip to content

Commit 00fbc39

Browse files
authored
Merge pull request #2070 from jdaugherty/newMongoMerge
switch to apache github actions & use GITHUB_TOKEN where possible
2 parents 9458682 + f3f07f6 commit 00fbc39

File tree

3 files changed

+28
-29
lines changed

3 files changed

+28
-29
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
version: 2
22
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
37
- package-ecosystem: gradle
48
directory: "/"
59
schedule:

.github/workflows/gradle.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,11 @@ jobs:
132132
with:
133133
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
134134
- name: "🔨 Build Docs"
135-
id: docs
136135
env:
137136
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
138-
run: ./gradlew docs --refresh-dependencies
137+
run: ./gradlew docs
139138
- name: "🚀 Publish to Github Pages"
140-
if: steps.docs.outcome == 'success'
141-
uses: grails/grails-github-actions/deploy-github-pages@main
139+
uses: apache/grails-github-actions/deploy-github-pages@asf
142140
env:
143141
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
144142
GRADLE_PUBLISH_RELEASE: 'false'
@@ -162,9 +160,19 @@ jobs:
162160
run: echo "value={\"message\":\"New Data Mapping Snapshots $(date) - $GITHUB_SHA\"}" >> $GITHUB_OUTPUT
163161
- name: "📡 Invoke the Java CI workflow in GORM Hibernate6"
164162
continue-on-error: true
165-
uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4 (Use commit sha as this is a 3rd party action)
163+
uses: actions/github-script@v7
166164
with:
167-
workflow: Java CI
168-
repo: grails/gorm-hibernate6
169-
ref: ${{ steps.extract_branch.outputs.value }}
170-
token: ${{ secrets.GH_TOKEN }}
165+
github-token: ${{ secrets.GH_TOKEN }} # must be a PAT since we're triggering on an external repo
166+
script: |
167+
try {
168+
const result = await github.rest.actions.createWorkflowDispatch({
169+
owner: 'apache',
170+
repo: 'grails-data-hibernate6',
171+
workflow_id: 'gradle.yml',
172+
ref: '${{ steps.extract_branch.outputs.value }}'
173+
});
174+
console.log(result);
175+
} catch(error) {
176+
console.error(error);
177+
core.setFailed(error);
178+
}

.github/workflows/release.yml

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,16 @@ name: "Release"
22
on:
33
release:
44
types: [published]
5-
env:
6-
GIT_USER_NAME: grails-build
7-
GIT_USER_EMAIL: [email protected]
5+
permissions:
6+
contents: write
7+
packages: read
88
jobs:
99
publish:
1010
name: "Publish to Sonatype Staging Repository"
1111
outputs:
1212
release_version: ${{ steps.release_version.outputs.value }}
1313
target_branch: ${{ steps.extract_branch.outputs.value }}
1414
runs-on: ubuntu-24.04
15-
permissions:
16-
contents: write
17-
packages: read
1815
steps:
1916
- name: "📥 Checkout repository"
2017
uses: actions/checkout@v4
@@ -28,7 +25,7 @@ jobs:
2825
with:
2926
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
3027
- name: "⚙️ Run pre-release"
31-
uses: grails/github-actions/pre-release@main
28+
uses: apache/grails-github-actions/pre-release@asf
3229
- name: "🔍 Determine Target Branch"
3330
id: extract_branch
3431
run: |
@@ -40,13 +37,11 @@ jobs:
4037
id: release_version
4138
run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
4239
- name: "🧩 Run Assemble"
43-
if: success()
4440
id: assemble
4541
env:
4642
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
47-
run: ./gradlew --refresh-dependencies assemble
43+
run: ./gradlew assemble
4844
- name: "📤 Upload Distribution to workflow summary page"
49-
if: success()
5045
uses: actions/upload-artifact@v4
5146
with:
5247
name: grails-data-mapping-${{ steps.release_version.outputs.value }}.zip
@@ -76,9 +71,6 @@ jobs:
7671
name: "Release Sonatype Staging Repository"
7772
needs: publish
7873
runs-on: ubuntu-24.04
79-
permissions:
80-
contents: write
81-
packages: read
8274
steps:
8375
- name: "📥 Checkout repository"
8476
uses: actions/checkout@v4
@@ -106,16 +98,12 @@ jobs:
10698
findSonatypeStagingRepository
10799
releaseSonatypeStagingRepository
108100
- name: "⚙️ Run post-release"
109-
if: success()
110-
uses: grails/github-actions/post-release@main
101+
uses: apache/grails-github-actions/post-release@asf
111102
docs:
112103
environment: release
113104
name: "Publish Documentation"
114105
needs: publish
115106
runs-on: ubuntu-24.04
116-
permissions:
117-
contents: write
118-
packages: read
119107
steps:
120108
- name: "📥 Checkout repository"
121109
uses: actions/checkout@v4
@@ -135,8 +123,7 @@ jobs:
135123
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
136124
run: ./gradlew docs
137125
- name: "🚀 Publish to Github Pages"
138-
if: success()
139-
uses: grails/grails-github-actions/deploy-github-pages@main
126+
uses: apache/grails-github-actions/deploy-github-pages@asf
140127
env:
141128
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
142129
GRADLE_PUBLISH_RELEASE: 'true'

0 commit comments

Comments
 (0)