Skip to content

Commit

Permalink
chore: Fix workflow typo and refactor to a single job (#1421)
Browse files Browse the repository at this point in the history
* chore: fix workflow steps typo

* refactor to a single job

* fix typo

* separate setting of github env
  • Loading branch information
alicejli authored Jan 11, 2024
1 parent 22d76ea commit 13a6379
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions .github/workflows/assets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,26 @@ env:
TAG_NAME: ${{ github.event.release.tag_name || github.event.inputs.tag }}

jobs:
get-upload-url-release:
name: Get upload URL for automated releases
if: ${{ github.event.release.tag_name }}
run: echo "GITHUB_UPLOAD_URL=${{ github.event.release.upload_url }}" >> $GITHUB_ENV
get-upload-url-manual:
name: Get upload URL for manually triggered releases
if: ${{ github.event.inputs.tag }}
uses: actions/github-script@v7
id: get-upload-url
with:
script: |
github.rest.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag: "${{ github.event.inputs.tag }}"
});
run: echo "GITHUB_UPLOAD_URL=${{ steps.get-upload-url.outputs.upload_url }}" >> $GITHUB_ENV
get-upload-url:
runs-on: ubuntu-latest
steps:
- name: Get upload URL for automated releases
if: ${{ github.event.release.tag_name }}
run: echo "GITHUB_UPLOAD_URL=${{ github.event.release.upload_url }}" >> $GITHUB_ENV
- name: Get upload URL for manually triggered releases
if: ${{ github.event.inputs.tag }}
id: get-upload-url
uses: actions/github-script@v7
with:
script: |
github.rest.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag: "${{ github.event.inputs.tag }}"
});
- name: Set environment variable
if: ${{ github.event.inputs.tag }}
run: echo "GITHUB_UPLOAD_URL=${{ steps.get-upload-url.outputs.upload_url }}" >> $GITHUB_ENV
proto-assets:
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit 13a6379

Please sign in to comment.