Update latest issues #726
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: Update latest issues | |
on: | |
schedule: | |
- cron: '0 12 * * *' # every day at noon | |
workflow_dispatch: {} | |
jobs: | |
update-latest-issues: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: update issues | |
id: updateIssues | |
run: bash ./sources-for-download/script-for-using-latest-version.sh | |
- uses: pCYSl5EDgo/cat@master | |
id: read_recent | |
with: | |
path: sources-for-download/regular-issues.txt | |
- run: | | |
echo "ISSUE_NUMBER=${{ steps.read_recent.outputs.text }}" >> $GITHUB_ENV | |
- name: config git | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "Joergi via GitHub Actions" | |
- name: Create Pull Request | |
id: createAutoPR | |
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v6 | |
with: | |
title: new Issue ${{ env.ISSUE_NUMBER }} - Automated PR | |
commit-message: new Issue ${{ env.ISSUE_NUMBER }} - Automated PR | |
token: ${{ secrets.MY_GITHUB_TOKEN }} | |
body: Automated pull request for issue ${{ env.ISSUE_NUMBER }} created by GitHub Actions | |
branch: automated_PR_for_update_issues | |
branch-suffix: timestamp | |
base: main | |
delete-branch: true | |
labels: "automerge" | |
- name: Auto approve | |
id: autoApprove | |
if: steps.createAutoPR.outputs.pull-request-operation == 'created' | |
uses: juliangruber/approve-pull-request-action@b71c44ff142895ba07fad34389f1938a4e8ee7b0 # v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
number: ${{ steps.createAutoPR.outputs.pull-request-number }} | |
- name: Enable Pull Request Automerge | |
if: steps.createAutoPR.outputs.pull-request-operation == 'created' | |
uses: peter-evans/enable-pull-request-automerge@a660677d5469627102a1c1e11409dd063606628d # v2 | |
with: | |
token: ${{ secrets.MY_GITHUB_TOKEN }} | |
pull-request-number: ${{ steps.createAutoPR.outputs.pull-request-number }} |