forked from facebook/hermes
-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (32 loc) · 1.14 KB
/
create-tag.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Publish Tag
on:
workflow_dispatch:
inputs:
rnVersion:
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:
runs-on: [ubuntu-latest]
steps:
- name: Get current date
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 }}-${{ steps.targetSha.outputs.targetSha }}',
sha: '${{ steps.targetSha.outputs.targetSha }}'
})