Skip to content

Commit 387e268

Browse files
chore: Simplify create-vsix inputs and improve branch resolution (#1772)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 17ef26f commit 387e268

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

.github/workflows/create-vsix.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,18 @@ jobs:
2727
private_key: ${{ secrets.BOT_PRIVATE_KEY }}
2828
- name: Set New GitHub Token
2929
run: echo "TOKEN=${{ steps.generate-token.outputs.token }}" >> $GITHUB_ENV
30-
# Trigger the build on vscode-brightscript-language. That workflow interprets these
31-
# inputs, builds the .vsix files, and posts the download links back on the PR
30+
# Resolve the input to a full PR URL (a bare PR number refers to this repo)
31+
- name: Resolve PR URL
32+
id: pr
33+
run: |
34+
input="${{ github.event.pull_request.html_url || github.event.inputs.pr }}"
35+
if [[ "$input" =~ ^[0-9]+$ ]]; then
36+
input="https://github.com/${{ github.repository }}/pull/$input"
37+
fi
38+
echo "url=$input" >> "$GITHUB_OUTPUT"
39+
# Trigger the build on vscode-brightscript-language. That workflow looks up the PR, builds the
40+
# .vsix files (preferring same-named branches attached to open PRs across all the projects),
41+
# and posts the download links back on the PR
3242
- name: Build vsix
3343
uses: aurelien-baudet/workflow-dispatch@v2.1.1
3444
id: create-vsix
@@ -39,4 +49,4 @@ jobs:
3949
display-workflow-run-url: true
4050
repo: rokucommunity/vscode-brightscript-language
4151
token: ${{ env.TOKEN }}
42-
inputs: '{ "branch": "${{ github.head_ref }}", "pr": "${{ github.event.pull_request.html_url || github.event.inputs.pr }}", "repo": "${{ github.repository }}" }'
52+
inputs: '{ "pr": "${{ steps.pr.outputs.url }}" }'

0 commit comments

Comments
 (0)