Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend the Tagging Github Action to accept a targetSha #750

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 12 additions & 3 deletions .github/workflows/create-tag.yml
Expand Up @@ -3,8 +3,11 @@ on:
workflow_dispatch:
inputs:
rnVersion:
description: 'The RN version that triggered this tagging'
description: "The RN version that triggered this tagging"
required: true
targetSha:
description: "The SHA you want to tag. If not specified it will tag the HEAD of main"
required: false

jobs:
publish:
Expand All @@ -15,13 +18,19 @@ jobs:
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"

- name: Get the target SHA
id: targetSha
run: echo "::set-output name=targetSha::$(if [ -z "$TARGET_SHA" ]; then echo $GITHUB_SHA; else echo $TARGET_SHA; fi)"
env:
TARGET_SHA: ${{ github.event.inputs.targetSha }}

- name: Create tag
uses: actions/github-script@v5
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/hermes-${{ steps.date.outputs.date }}-RNv${{ github.event.inputs.rnVersion }}-${{ github.sha }}',
sha: context.sha
ref: 'refs/tags/hermes-${{ steps.date.outputs.date }}-RNv${{ github.event.inputs.rnVersion }}-${{ steps.targetSha.outputs.targetSha }}',
sha: '${{ steps.targetSha.outputs.targetSha }}'
})