Skip to content

Commit 08df742

Browse files
committed
fix: resolve github-tools ref from github.workflow_ref
1 parent 0f2aa18 commit 08df742

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/publish-preview.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,20 @@ jobs:
166166
with:
167167
name: preview-build-artifacts
168168

169+
- name: Resolve GitHub tools ref
170+
id: github-tools-ref
171+
run: |
172+
# github.workflow_ref contains e.g. "Owner/repo/.github/workflows/file.yml@refs/heads/branch"
173+
ref="${WORKFLOW_REF##*@}"
174+
echo "ref=$ref" >> "$GITHUB_OUTPUT"
175+
env:
176+
WORKFLOW_REF: ${{ github.workflow_ref }}
177+
169178
- name: Checkout GitHub tools repository
170179
uses: actions/checkout@v5
171180
with:
172181
repository: MetaMask/github-tools
173-
ref: ${{ github.workflow_sha }}
182+
ref: ${{ steps.github-tools-ref.outputs.ref }}
174183
path: ./.github-tools
175184

176185
# The artifact package.json files come from the PR branch.

0 commit comments

Comments
 (0)