Skip to content

Commit 0e7d9ea

Browse files
authored
Merge pull request #28 from projectdiscovery/27-automatic-release-action
release tag template
2 parents 0bc9300 + ea33959 commit 0e7d9ea

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/release_tag.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: 🔖 Release Tag
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 0 * * 0'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check out code
13+
uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Get Commit Count
18+
id: get_commit
19+
run: git rev-list `git rev-list --tags --no-walk --max-count=1`..HEAD --count | xargs -I {} echo COMMIT_COUNT={} >> $GITHUB_OUTPUT
20+
21+
- name: Create release and tag
22+
if: ${{ steps.get_commit.outputs.COMMIT_COUNT > 0 }}
23+
id: tag_version
24+
uses: mathieudutour/github-tag-action@v6.1
25+
with:
26+
github_token: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Create a GitHub release
29+
if: ${{ steps.get_commit.outputs.COMMIT_COUNT > 0 }}
30+
uses: actions/create-release@v1
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
with:
34+
tag_name: ${{ steps.tag_version.outputs.new_tag }}
35+
release_name: Release ${{ steps.tag_version.outputs.new_tag }}
36+
body: ${{ steps.tag_version.outputs.changelog }}

0 commit comments

Comments
 (0)