Skip to content

Commit 5e13590

Browse files
author
OCurdy
committed
ci: replace xt0rted/pull-request-comment-branch with gh CLI
1 parent eaac42f commit 5e13590

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

.github/workflows/artifacts.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,14 @@ jobs:
3232
ref: ${{ github.event_name == 'issue_comment' && steps.comment-branch.outputs.head_ref || '' }}
3333

3434
steps:
35-
- uses: xt0rted/pull-request-comment-branch@v1
35+
- name: Get PR head ref
3636
if: github.event_name == 'issue_comment'
3737
id: comment-branch
38+
run: |
39+
head_ref=$(gh pr view ${{ github.event.issue.number }} --json headRefName --jq '.headRefName')
40+
echo "head_ref=$head_ref" >> $GITHUB_OUTPUT
41+
env:
42+
GH_TOKEN: ${{ github.token }}
3843

3944
build-archive-docker:
4045
needs: checks
@@ -57,10 +62,10 @@ jobs:
5762
cache: 'npm'
5863

5964
- name: Derive appropriate SHAs for base and head for `nx affected` commands
60-
uses: nrwl/nx-set-shas@v4
65+
uses: nrwl/nx-set-shas@v5
6166
with:
6267
main-branch-name: 'geocat'
63-
fallback-sha: e59ec426e057c349b36441c4f6b1b4f64cef9912
68+
fallback-sha: b5fac1a33b5c4df0f5db183ae09e956f3a327f51
6469

6570
- name: Install dependencies
6671
run: npm ci
@@ -96,7 +101,7 @@ jobs:
96101

97102
- name: Tag all docker images on main also as latest
98103
if: github.event_name == 'push' # only happens when pushing on the main branch
99-
run: docker image ls --format 'docker tag {{.Repository}}:{{.Tag}} {{.Repository}}:latest' --filter=reference='camptocamp/*' | bash -
104+
run: docker image ls --format 'docker tag {{.Repository}}:{{.Tag}} {{.Repository}}:latest' --filter=reference='geoadmin/*' | bash -
100105

101106
- name: Login to Github Packages
102107
uses: docker/login-action@v2
@@ -108,7 +113,7 @@ jobs:
108113
- name: Push all docker images
109114
# list all docker images, keep only the ones in the geonetwork org, and call docker push for each of them
110115
run: |
111-
docker image ls --format '{{.Repository}}:{{.Tag}}' --filter=reference='camptocamp/*' | \
116+
docker image ls --format '{{.Repository}}:{{.Tag}}' --filter=reference='geoadmin/*' | \
112117
xargs -I '{}' docker tag '{}' ghcr.io/'{}'
113118
docker image ls --format '{{.Repository}}:{{.Tag}}' |grep ghcr.io | \
114119
xargs -r -L1 docker push $1

0 commit comments

Comments
 (0)