Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
NX_BRANCH: ${{ github.event.number || github.ref_name }}
steps:
- id: get-secrets
if: ${{ github.event.pull_request.head.repo.fork != true }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a github workflow thing or can we write ${{ github.event.pull_request.head.repo.fork == false }} instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to Claude, on push events github.event.pull_reques is null, so .head.repo.fork is also null. null != true evaluates to true (step runs), but null == false would be false and skip vault secrets on main. This is kind of hard to verify, but it's describe here: https://github.com/orgs/community/discussions/25645

uses: grafana/shared-workflows/actions/get-vault-secrets@a37de51f3d713a30a9e4b21bcdfbd38170020593 # get-vault-secrets/v1.3.0
with:
# Secrets placed in the ci/repo/grafana/plugin-tools in vault
Expand Down Expand Up @@ -89,6 +90,7 @@ jobs:
WORKING_DIR: 'myorg-nobackend-panel'
steps:
- id: get-secrets
if: ${{ github.event.pull_request.head.repo.fork != true }}
uses: grafana/shared-workflows/actions/get-vault-secrets@a37de51f3d713a30a9e4b21bcdfbd38170020593 # get-vault-secrets/v1.3.0
with:
# Secrets placed in the ci/repo/grafana/plugin-tools in vault
Expand Down Expand Up @@ -161,6 +163,7 @@ jobs:
working-directory: ./${{ env.WORKING_DIR }}

- name: '@grafana/sign-plugin - use GRAFANA_ACCESS_POLICY_TOKEN to sign generate-panel plugin'
if: ${{ github.event.pull_request.head.repo.fork != true }}
env:
GRAFANA_ACCESS_POLICY_TOKEN: ${{ fromJSON(steps.get-secrets.outputs.secrets).GRAFANA_ACCESS_POLICY_TOKEN }}
run: sign-plugin --rootUrls http://www.example.com --signatureType private
Expand Down Expand Up @@ -274,6 +277,7 @@ jobs:
hasBackend: false
steps:
- id: get-secrets
if: ${{ github.event.pull_request.head.repo.fork != true }}
uses: grafana/shared-workflows/actions/get-vault-secrets@a37de51f3d713a30a9e4b21bcdfbd38170020593 # get-vault-secrets/v1.3.0
with:
# Secrets placed in the ci/repo/grafana/plugin-tools in vault
Expand All @@ -282,6 +286,7 @@ jobs:
export_env: false

- name: Get secrets for DockerHub login
if: ${{ github.event.pull_request.head.repo.fork != true }}
uses: grafana/shared-workflows/actions/get-vault-secrets@a37de51f3d713a30a9e4b21bcdfbd38170020593 # get-vault-secrets/v1.3.0
with:
common_secrets: |
Expand Down Expand Up @@ -367,6 +372,7 @@ jobs:
working-directory: ./${{ matrix.workingDir }}

- name: Log in to Docker Hub
if: ${{ github.event.pull_request.head.repo.fork != true }}
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
username: ${{ env.DOCKERHUB_USERNAME }}
Expand Down Expand Up @@ -460,7 +466,7 @@ jobs:
working-directory: ./${{ matrix.workingDir }}

- name: '@grafana/sign-plugin - use GRAFANA_ACCESS_POLICY_TOKEN to sign generate-panel plugin'
if: ${{ matrix.workingDir == 'myorg-nobackend-panel' && github.actor != 'dependabot[bot]' }}
if: ${{ matrix.workingDir == 'myorg-nobackend-panel' && github.actor != 'dependabot[bot]' && github.event.pull_request.head.repo.fork != true }}
env:
Comment thread
sunker marked this conversation as resolved.
GRAFANA_ACCESS_POLICY_TOKEN: ${{ fromJSON(steps.get-secrets.outputs.secrets).GRAFANA_ACCESS_POLICY_TOKEN }}
run: sign-plugin --rootUrls http://www.example.com --signatureType private
Expand All @@ -481,7 +487,7 @@ jobs:
run: exit 1

publish-report:
if: ${{ always() && !cancelled() }}
if: ${{ always() && !cancelled() && github.event.pull_request.head.repo.fork != true }}
needs: [generate-plugins]
runs-on: ubuntu-x64
permissions:
Expand Down
Loading