Skip to content

Commit

Permalink
Merge pull request projectdiscovery#75 from projectdiscovery/issue-74…
Browse files Browse the repository at this point in the history
…-autorelease-gh

add autorelease gh action
  • Loading branch information
Mzack9999 authored Nov 17, 2022
2 parents 84e714b + edc232b commit d77955f
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/autorelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: 🔖 Auto release gh action

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get Commit Count
id: get_commit
run: git rev-list `git rev-list --tags --no-walk --max-count=1`..HEAD --count | xargs -I {} echo COMMIT_COUNT={} >> $GITHUB_OUTPUT

- name: Create release and tag
if: ${{ steps.get_commit.outputs.COMMIT_COUNT > 0 }}
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Create a GitHub release
if: ${{ steps.get_commit.outputs.COMMIT_COUNT > 0 }}
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag_version.outputs.new_tag }}
release_name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}

0 comments on commit d77955f

Please sign in to comment.