Skip to content

Commit 90d0e66

Browse files
committed
Fix added slack_hook
1 parent 86de8ac commit 90d0e66

2 files changed

Lines changed: 26 additions & 11 deletions

File tree

.github/workflows/dependency-update.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
# Every Monday at 03:00 UTC
66
- cron: "0 3 * * 1"
77
workflow_dispatch:
8-
workflow_call:
98

109
jobs:
1110
dependency-update:
@@ -22,6 +21,14 @@ jobs:
2221
with:
2322
fetch-depth: 0
2423

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+
2532
- name: Set up Python & Poetry Environment
2633
id: set-up-python-and-poetry-environment
2734
uses: exasol/python-toolbox/.github/actions/python-environment@v6
@@ -83,14 +90,18 @@ jobs:
8390
run: |
8491
BASE_BRANCH=$(gh repo view --json defaultBranchRef -q .defaultBranchRef.name)
8592
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\`.
9194
This PR was created by the dependency update workflow after running:
9295
- \`poetry run -- nox -s dependency:audit\`
9396
- \`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+
94105
- name: Report new Pull Request to Slack channel
95106
id: report-pr-slack
96107
if: ${{ steps.create-pr.outputs.pr_url }}

exasol/toolbox/templates/github/workflows/dependency-update.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,18 @@ jobs:
9090
run: |
9191
BASE_BRANCH=$(gh repo view --json defaultBranchRef -q .defaultBranchRef.name)
9292
93-
pr_url=$(gh pr create \
94-
--base "$BASE_BRANCH" \
95-
--title "Update dependencies to fix vulnerabilities ($(date '+%Y-%m-%d'))" \
96-
--body "Automated dependency update for \`poetry.lock\`.)
97-
echo "pr_url=$pr_url" >> "$GITHUB_OUTPUT"
93+
PR_BODY="Automated dependency update for \`poetry.lock\`.
9894
This PR was created by the dependency update workflow after running:
9995
- \`poetry run -- nox -s dependency:audit\`
10096
- \`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+
101105
- name: Report new Pull Request to Slack channel
102106
id: report-pr-slack
103107
if: ${{ steps.create-pr.outputs.pr_url }}

0 commit comments

Comments
 (0)