Skip to content

Commit

Permalink
ci: prのheadのshaを取得する
Browse files Browse the repository at this point in the history
  • Loading branch information
rito528 committed Dec 16, 2023
1 parent 174793a commit 5f14803
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions .github/workflows/create_1_18_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,9 @@ on:
- .github/actions/**/**.yml

jobs:
output-sha:
name: 最終コミットのSHA値を取得する
runs-on: ubuntu-20.04
outputs:
sha: ${{ steps.output-sha.outputs.sha }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Outputs the value
id: output-sha
run: |
VALUE=$(git log --format='%h' -n 1)
echo "sha=$VALUE" >> $GITHUB_OUTPUT
shell: bash

create_release:
runs-on: ubuntu-20.04
container: ghcr.io/giganticminecraft/seichiassist-builder-v2:424c09f
needs:
- output-sha
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand Down Expand Up @@ -105,7 +88,7 @@ jobs:
- name: Create and push a tag
id: tag-name
run: |
TAG_NAME=pr-${{ github.event.pull_request.number }}-${{ needs.output-sha.outputs.sha }}
TAG_NAME=pr-${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}
git tag $TAG_NAME
git push origin $TAG_NAME
echo "value=$TAG_NAME" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit 5f14803

Please sign in to comment.