Update NOTICE with org repositories #101
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: Update NOTICE with org repositories | |
| on: | |
| schedule: | |
| # alle 2 Wochen montags um 02:00 UTC | |
| - cron: "0 2 * * 1/2" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| update-notice: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install GitHub CLI + jq | |
| run: sudo apt-get update && sudo apt-get install -y gh jq | |
| - name: Fetch repo list | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh repo list eclipse-xfsc --limit 500 --json nameWithOwner,isArchived,isPrivate \ | |
| | jq -r '.[] | select(.isArchived==false) | select(.isPrivate==false) | .nameWithOwner' \ | |
| | sed 's#^#* https://github.com/#' > repo_list.txt | |
| - name: Replace Source Code section in NOTICE.md | |
| run: | | |
| # Header bis Source Code kopieren | |
| sed -n '1,/^## Source Code/p' NOTICE.md > NOTICE.new | |
| # Neue Section einfügen | |
| { | |
| echo | |
| echo "The project maintains the following source code repositories:" | |
| echo | |
| cat repo_list.txt | |
| echo | |
| } >> NOTICE.new | |
| # Rest ab Cryptography anhängen | |
| sed -n '/^## Cryptography/,$p' NOTICE.md >> NOTICE.new | |
| mv NOTICE.new NOTICE.md | |
| - name: Commit and push changes | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add NOTICE.md | |
| git commit -m "chore: update NOTICE.md with latest repos from eclipse-xfsc org" || echo "No changes" | |
| git push |