|
5 | 5 | # Every Monday at 03:00 UTC |
6 | 6 | - cron: "0 3 * * 1" |
7 | 7 | workflow_dispatch: |
8 | | - workflow_call: |
9 | 8 |
|
10 | 9 | jobs: |
11 | 10 | dependency-update: |
|
22 | 21 | with: |
23 | 22 | fetch-depth: 0 |
24 | 23 |
|
| 24 | + - name: Fail if not running on the default branch |
| 25 | + id: check-branch |
| 26 | + if: github.ref != format('refs/heads/{0}', github.event.repository.default_branch) |
| 27 | + uses: actions/github-script@v8 |
| 28 | + with: |
| 29 | + script: | |
| 30 | + core.setFailed('Not running on the default branch. github.ref is ${{ github.ref }}') |
| 31 | +
|
25 | 32 | - name: Set up Python & Poetry Environment |
26 | 33 | id: set-up-python-and-poetry-environment |
27 | 34 | uses: exasol/python-toolbox/.github/actions/python-environment@v6 |
@@ -83,14 +90,18 @@ jobs: |
83 | 90 | run: | |
84 | 91 | BASE_BRANCH=$(gh repo view --json defaultBranchRef -q .defaultBranchRef.name) |
85 | 92 |
|
86 | | - pr_url=$(gh pr create \ |
87 | | - --base "$BASE_BRANCH" \ |
88 | | - --title "Update dependencies to fix vulnerabilities ($(date '+%Y-%m-%d'))" \ |
89 | | - --body "Automated dependency update for \`poetry.lock\`.) |
90 | | - echo "pr_url=$pr_url" >> "$GITHUB_OUTPUT" |
| 93 | + PR_BODY="Automated dependency update for \`poetry.lock\`. |
91 | 94 | This PR was created by the dependency update workflow after running: |
92 | 95 | - \`poetry run -- nox -s dependency:audit\` |
93 | 96 | - \`poetry update\`" |
| 97 | +
|
| 98 | + PR_URL=$(gh pr create \ |
| 99 | + --base "$BASE_BRANCH" \ |
| 100 | + --title "Update dependencies to fix vulnerabilities ($(date '+%Y-%m-%d'))" \ |
| 101 | + --body "$PR_BODY") |
| 102 | +
|
| 103 | + echo "pr_url=PR_URL" >> "$GITHUB_OUTPUT" |
| 104 | +
|
94 | 105 | - name: Report new Pull Request to Slack channel |
95 | 106 | id: report-pr-slack |
96 | 107 | if: ${{ steps.create-pr.outputs.pr_url }} |
|
0 commit comments