Release #12
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: workflow_dispatch | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Update file and tag | |
id: update_file | |
run: | | |
DATE=$(date +"%s") | |
echo $DATE >> file.txt | |
echo "date_tag=$(echo $DATE)" >> $GITHUB_OUTPUT | |
- name: Create Branch | |
run: | | |
git checkout -b release-${{ steps.update_file.outputs.date_tag }} | |
git push -f -u origin release-${{ steps.update_file.outputs.date_tag }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.PBB_GH_TOKEN }} | |
- uses: planetscale/ghcommit-action@b662a9d7235a07e80d976152ed5afe41651c4973 | |
with: | |
commit_message: "Auto PR for ${{ steps.update_file.outputs.date_tag }}" | |
repo: ${{ github.repository }} | |
branch: release-${{ steps.update_file.outputs.date_tag }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.PBB_GH_TOKEN }} | |
- name: Create PR | |
id: create_pr | |
run: | | |
TITLE="Auto PR for ${{ steps.update_file.outputs.date_tag }}" | |
BODY="This is an auto PR for ${{ steps.update_file.outputs.date_tag }}" | |
PR_URL=$(gh pr create -B main -H release-${{ steps.update_file.outputs.date_tag }} --title "$TITLE" --body "$BODY") | |
PR_NUMBER=$(echo $PR_URL | awk -F'/' '{print $NF}') | |
echo "pr_number=$(echo $PR_NUMBER)" >> $GITHUB_OUTPUT | |
gh pr merge --auto --squash | |
env: | |
GITHUB_TOKEN: ${{ secrets.PBB_GH_TOKEN }} | |
- name: Auto Approve PR | |
uses: hmarr/auto-approve-action@v4 | |
with: | |
pull-request-number: ${{ steps.create_pr.outputs.pr_number }} | |