fix: new application redirect non logged users #2936
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: "Auto approve PRs by bots" | |
on: | |
# Trigger when any action on a pull request is taken. | |
pull_request_target: | |
jobs: | |
approve: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write # Allows approving the PR. | |
contents: write # Allows merging the PR. | |
# Only run if one of the defined bots is the pull request author. | |
# https://github.com/City-of-Helsinki/tilavarauspalvelu-core/settings/variables/actions | |
if: contains(fromJSON(vars.BOTS), github.event.pull_request.user.login) | |
steps: | |
- name: "Check out repository" | |
uses: actions/checkout@v4 | |
- name: "Approve a pull request and set to auto rebase-merge if tests pass" | |
# Only approve the PR if it's not already approved to avoid email spam. | |
# Don't auto-merge PRs for frontend as they are not tests automatically. | |
run: | | |
gh pr checkout "$PR_URL" | |
if [ "$(gh pr status --json reviewDecision -q .currentBranch.reviewDecision)" == "APPROVED" ]; | |
then echo "PR already approved." | |
elif [ "$(gh pr status --json labels -q .currentBranch.labels[].name | grep -c "javascript")" -eq 1 ]; | |
then echo "Dependabot PRs for frontend are not auto-merged." | |
else | |
gh pr review --approve "$PR_URL"; | |
gh pr merge --auto --rebase "$PR_URL" | |
fi | |
env: | |
PR_URL: ${{ github.event.pull_request.html_url }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |