Created
January 31, 2024 22:36
-
-
Save imjn/f78780c208d657ddbd8d30dabc4f3a27 to your computer and use it in GitHub Desktop.
Create an issue with a list of outdated Swift packages
This file contains hidden or 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: Swift Package Dependency Check | |
on: | |
schedule: | |
- cron: '0 8 * * 1' | |
jobs: | |
build: | |
runs-on: macos-latest | |
permissions: | |
contents: read | |
issues: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check Swift version | |
run: | | |
swift --version | |
- name: Install swift-outdated | |
run: | | |
brew install swift-outdated | |
- name: Check for outdated dependencies | |
run: | | |
swift outdated -f markdown > outdated.md | |
- name: Close existing Issues with outdated-dependencies label | |
run: | | |
issues=$(gh issue list -l "outdated-dependencies" -s open --json number -q ".[].number") | |
for issue in $issues; do | |
gh issue close $issue --comment "New report generated" | |
done | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GH_REPO: ${{ github.repository }} | |
- name: Create Issue | |
run: | | |
year=$(date +"%Y") | |
week_number=$(date +"%V") | |
issue_title="Outdated Dependencies - Week $week_number, $year" | |
gh issue create --title "$issue_title" -F outdated.md -l "outdated-dependencies" | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GH_REPO: ${{ github.repository }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment