Skip to content

Commit

Permalink
workflows: fix repository name in summary
Browse files Browse the repository at this point in the history
github.event is empty in case of sceduled workflows.
Repository name should be fetched through github.repository variable instead.
  • Loading branch information
eugkoira committed Jul 25, 2022
1 parent b336660 commit 49bc251
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/summary.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Notify owners with a summary about open issues and PRs

on:
workflow_dispatch:
schedule:
- cron: "0 7 * * 1"

Expand All @@ -24,11 +25,13 @@ jobs:
gh issue list --json title,updatedAt,labels,assignees,url --template \
'{{ printf "URL\tTitle\tLast updated\n"}}{{range .}}{{printf "%s\t%s\t%s\n" .url .title (timeago .updatedAt)}}{{end}}' | column -ts $'\t' >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
# Fetch repository name and store it to
# REPOSITORY_NAME environment variable
echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
- name: notify
run: |
# Send open PRs and issues lists from corresponding environment variables to a dedicated webhook URL
curl -d '{ "repo": "${{ github.event.repository.name }}", "prs": "${{ env.PRS_CONTENT }}", "issues": "${{ env.ISSUES_CONTENT }}" }' ${{ secrets.SUMMARY_WEBHOOK_URL }}
curl -d '{ "repo": "${{ env.REPOSITORY_NAME }}", "prs": "${{ env.PRS_CONTENT }}", "issues": "${{ env.ISSUES_CONTENT }}" }' ${{ secrets.SUMMARY_WEBHOOK_URL }}

0 comments on commit 49bc251

Please sign in to comment.