fix permissions #485
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: update.sh | |
permissions: | |
# Git push permissions are needed | |
contents: write | |
pull-requests: write | |
on: | |
push: | |
branches: | |
- master | |
- update.sh-fix-working-with-existing-branch | |
schedule: | |
- cron: '11 0 * * *' | |
workflow_dispatch: | |
jobs: | |
run_update_sh: | |
name: Run update.sh script | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.WOKFLOW_TOKEN }} | |
- name: Run update.sh script | |
run: ./update.sh | |
- name: Commit files | |
run: | | |
BRANCH="changes-from-update.sh-$(date +'%Y-%m-%d')" | |
git show-ref --quiet "$BRANCH" && { "ERROR: Branch $BRANCH already exists"; exit 1; } | |
git switch -C "$BRANCH" | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Workflow" | |
git add -A | |
git commit -m "Update roundcube version (via update.sh)" || echo "Nothing to update" | |
git push --set-upstream origin "$BRANCH" | |
- name: Create Pull Request | |
run: gh pr create -B master -H changes-from-update.sh --title 'Changes from update.sh' --body "These are the changes of the automated run of ./update.sh" --assignee pabzm | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |