File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Tag version on merge
2+ on :
3+ push :
4+ branches : [main]
5+ paths : ['lib/aws_lambda_ric/version.rb']
6+
7+ jobs :
8+ tag :
9+ runs-on : ubuntu-latest
10+ permissions :
11+ contents : write
12+ steps :
13+ - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
14+
15+ - name : Check version
16+ id : check
17+ run : |
18+ VERSION=$(ruby -e "require './lib/aws_lambda_ric/version'; puts AwsLambdaRIC::VERSION")
19+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
20+ if git rev-parse "refs/tags/$VERSION" >/dev/null 2>&1; then
21+ echo "tag_exists=true" >> "$GITHUB_OUTPUT"
22+ else
23+ echo "tag_exists=false" >> "$GITHUB_OUTPUT"
24+ fi
25+
26+ - name : Create tag
27+ if : steps.check.outputs.tag_exists == 'false'
28+ run : |
29+ git tag ${{ steps.check.outputs.version }}
30+ git push origin ${{ steps.check.outputs.version }}
You can’t perform that action at this time.
0 commit comments