name: CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
types: [ closed, opened, synchronize, reopened ]
issue_comment:
types: [created]
if: contains(github.event.comment.body, 'digger')
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
pull-requests: write
env:
SERVICE_ACCOUNT: sa-ar-digger-gha-any@prj-c-artifacts-62d0.iam.gserviceaccount.com
GOOGLE_STORAGE_BUCKET: terraform-digger-gha-pr-locks-814b
steps:
- uses: actions/checkout@v3
- name: Checkout Pull Request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_URL="${{ github.event.issue.pull_request.url }}"
PR_NUM=${PR_URL##*/}
echo "Checking out from PR #$PR_NUM based on URL: $PR_URL"
hub pr checkout $PR_NUM
if: github.event_name == 'issue_comment'
- id: auth
uses: google-github-actions/auth@v1
with:
token_format: access_token
workload_identity_provider: ${{ secrets.GCP__GHA__WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ env.SERVICE_ACCOUNT }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1
- name: Use gcloud CLI
run: |
gcloud info
gsutil ls gs://${{ env.GOOGLE_STORAGE_BUCKET }}
- name: digger tfrun
uses: diggerhq/[email protected]
env:
LOCK_PROVIDER: gcp
GITHUB_CONTEXT: ${{ toJson(github) }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
...
Run gcloud info
Installation Properties: [/opt/hostedtoolcache/gcloud/424.0.0/x64/properties]
User Config Directory: [/home/runner/.config/gcloud]
Active Configuration Name: [default]
Active Configuration Path: [/home/runner/.config/gcloud/configurations/config_default]
Account: [sa-ar-digger-gha-any@prj-c-artifacts-62d0.iam.gserviceaccount.com]
Project: [prj-c-artifacts-62d0]
Current Properties:
[auth]
credential_file_override: [/home/runner/work/digger-test/digger-test/gha-creds-43e0236a61a1ec40.json] (environment)
[core]
account: [sa-ar-digger-gha-any@prj-c-artifacts-62d0.iam.gserviceaccount.com] (property file)
disable_usage_reporting: [True] (property file)
project: [prj-c-artifacts-62d0] (environment)
[metrics]
environment: [github-actions-setup-gcloud] (environment)
environment_version: [1.1.0] (environment)
Logs Directory: [/home/runner/.config/gcloud/logs]
Last Log File: [/home/runner/.config/gcloud/logs/2023.04.04/14.49.[55](https://github.com/nuecho/digger-test/actions/runs/4609142469/jobs/8145864767#step:6:56).0233[65](https://github.com/nuecho/digger-test/actions/runs/4609142469/jobs/8145864767#step:6:66).log]
git: [git version 2.40.0]
ssh: [OpenSSH_8.9p1 Ubuntu-3ubuntu0.1, OpenSSL 3.0.2 15 Mar 2022]
gs://terraform-digger-gha-pr-locks-814b/test.txt
...
Run diggerhq/[email protected]
Run curl -sL [https://github.com/diggerhq/digger/releases/download/${actionref}/digger-Linux-X64](https://github.com/diggerhq/digger/releases/download/$%7Bactionref%7D/digger-Linux-X64) -o digger
Digger config read successfully
Lock has been created successfully
GitHub context parsed successfully
GitHub event processed successfully
GitHub event converted to commands successfully
Lock nuecho/digger-test#default
failed to get bucket attributes: googleapi: Error 403: sa-ar-digger-gha-any@prj-c-artifacts-62d0.iam.gserviceaccount.com does not have storage.buckets.get access to the Google Cloud Storage bucket. Permission 'storage.buckets.get' denied on resource (or it may not exist)., forbidden
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xcfef04]
goroutine 1 [running]:
digger/pkg/gcp.(*GoogleStorageLock).Lock(0xc00007f4e0, 0xc0007841a0?, {0xc0007841a0, 0x1a})
/home/runner/work/digger/digger/pkg/gcp/gcp_lock.go:41 +0x384
digger/pkg/utils.(*ProjectLockImpl).Lock(0xc00070bcc0, {0xc0007841a0, 0x1a}, 0x1)
/home/runner/work/digger/digger/pkg/utils/locking.go:60 +0x369
digger/pkg/digger.DiggerExecutor.Plan({{0x0, 0x0}, {0x100b75a, 0x7}, {0xc0000387f8, 0x6}, {0x100b75a, 0x7}, {0x1007b20, 0x1}, ...}, ...)
/home/runner/work/digger/digger/pkg/digger/digger.go:233 +0x253
digger/pkg/digger.RunCommandsPerProject({0xc00070bc70?, 0x1, 0xc0001181e0?}, {0xc0000387f8, 0x6}, {0xc0000387ff, 0xb}, {0xc0001182a0, 0xc}, 0x1, ...)
/home/runner/work/digger/digger/pkg/digger/digger.go:76 +0x605
main.main()
/home/runner/work/digger/digger/cmd/digger/main.go:67 +0x709
Error: Process completed with exit code 2.