Skip to content

Commit ae11e1d

Browse files
authored
Merge pull request #60 from ONSdigital/ras-1737-fix-dependabot-workflow
fix dependabot workflow
2 parents 78cbcdd + 5eebd7a commit ae11e1d

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

.github/workflows/main.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ on:
55
branches: [ main ]
66
pull_request:
77
branches: [ main ]
8-
workflow_dispatch:
9-
branches: [ main ]
108

119
env:
1210
IMAGE: print-file
@@ -32,35 +30,37 @@ jobs:
3230
run: |
3331
make test
3432
- name: Authenticate with Google Cloud
35-
if: github.event.pull_request.user.login != 'dependabot[bot]'
33+
if: github.actor != 'dependabot[bot]'
3634
id: auth
3735
uses: google-github-actions/auth@ba79af03959ebeac9769e648f473a284504d9193 # v2.1.10
3836
with:
3937
credentials_json: ${{ secrets.GCR_KEY }}
4038
- name: Setup Google Cloud SDK
41-
if: github.event.pull_request.user.login != 'dependabot[bot]'
39+
if: github.actor != 'dependabot[bot]'
4240
uses: google-github-actions/setup-gcloud@77e7a554d41e2ee56fc945c52dfd3f33d12def9a # v2.1.4
43-
- run: |
41+
- name: Configure Docker for Artifact Registry
42+
if: github.actor != 'dependabot[bot]'
43+
run: |
4444
gcloud auth configure-docker
4545
gcloud auth configure-docker "$REGISTRY_HOSTNAME"
4646
- name: pr docker tag
47-
if: github.ref != 'refs/heads/main' && github.event.pull_request.user.login != 'dependabot[bot]'
47+
if: github.ref != 'refs/heads/main' && github.actor != 'dependabot[bot]'
4848
id: tag
4949
run: |
5050
PR=$(echo "$GITHUB_REF" | awk -F / '{print $3}')
5151
echo "$PR"
5252
echo "pr_number=pr-$PR" >> $GITHUB_ENV
5353
# Build the Docker image
5454
- name: Build Docker Image
55-
if: github.ref != 'refs/heads/main' && github.event.pull_request.user.login != 'dependabot[bot]'
55+
if: github.ref != 'refs/heads/main' && github.actor != 'dependabot[bot]'
5656
run: |
5757
docker build -f _infra/docker/Dockerfile -t "$REGISTRY_HOSTNAME"/"$GAR_GOOGLE_PROJECT_ID"/"$GAR_REPOSITORY"/"$IMAGE":${{ env.pr_number }} .
5858
- name: Push dev image
59-
if: github.ref != 'refs/heads/main' && github.event.pull_request.user.login != 'dependabot[bot]'
59+
if: github.ref != 'refs/heads/main' && github.actor != 'dependabot[bot]'
6060
run: |
6161
docker push "$REGISTRY_HOSTNAME"/"$GAR_GOOGLE_PROJECT_ID"/"$GAR_REPOSITORY"/"$IMAGE":${{ env.pr_number }}
6262
- name: template helm
63-
if: github.event.pull_request.user.login != 'dependabot[bot]'
63+
if: github.actor != 'dependabot[bot]'
6464
run: |
6565
helm template $CHART_DIRECTORY
6666
- name: Set current tag
@@ -148,14 +148,14 @@ jobs:
148148
echo "version=$(grep -E "appVersion:\s+" $CHART_DIRECTORY/Chart.yaml | cut -d" " -f2 | sed -r 's/"//g')" >> $GITHUB_ENV
149149
150150
- name: package helm
151-
if: github.event.pull_request.user.login != 'dependabot[bot]'
151+
if: github.actor != 'dependabot[bot]'
152152
run: |
153153
echo HELM_VERSION=$(grep -E "version:\s+" $CHART_DIRECTORY/Chart.yaml | cut -d" " -f2 | sed -r 's/"//g') >> $GITHUB_ENV
154154
helm dep up $CHART_DIRECTORY
155155
helm package $CHART_DIRECTORY
156156
157157
- name: Publish dev Chart
158-
if: github.ref != 'refs/heads/main' && github.event.pull_request.user.login != 'dependabot[bot]'
158+
if: github.ref != 'refs/heads/main' && github.actor != 'dependabot[bot]'
159159
run: |
160160
mv $IMAGE-${{ env.HELM_VERSION }}.tgz $IMAGE-${{ env.pr_number }}.tgz
161161
gsutil cp $IMAGE-*.tgz gs://$ARTIFACT_BUCKET/$IMAGE/

_infra/helm/print-file/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ description: A Helm chart for deploying the rasrm print file generator
44

55
type: application
66

7-
version: 1.0.47
7+
version: 1.0.48
88

9-
appVersion: 1.0.47
9+
appVersion: 1.0.48

0 commit comments

Comments
 (0)