-
Notifications
You must be signed in to change notification settings - Fork 0
New setup for automatic updates on GH Actions #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
oprypin
wants to merge
5
commits into
main
Choose a base branch
from
next
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
93ab917
Switch from MkDocs to ProperDocs
oprypin 9b75f71
Delete "history/" directory, it will not be populated
oprypin 9d845a9
Remove `labels: []`, they will be auto-populated
oprypin c6416e0
Delete configuration, it will be managed in the generator repo
oprypin 32f77f6
New setup for automatic updates on GH Actions
oprypin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,79 +1,32 @@ | ||
| # Based on https://github.com/best-of-lists/best-of-update-action/blob/v0.8.5/workflows/update-best-of-list.yml | ||
| name: update-best-of-list | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: "Version to use for this update" | ||
| required: false | ||
| schedule: | ||
| - cron: "0 18 * * 4" # Every thursday at 6pm | ||
| - cron: '32 6 * * 6' # At 06:32 every Saturday | ||
|
|
||
| env: | ||
| BRANCH_PREFIX: "update/" | ||
| DEFAULT_BRANCH: "main" | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| update-best-of-list: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - if: ${{ github.event.inputs != null && github.event.inputs.version != null }} | ||
| name: set-version-from-input | ||
| run: echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV | ||
| - if: ${{ ! (env.VERSION != null && env.VERSION != '') }} | ||
| name: set-version-via-date | ||
| run: echo "VERSION=$(date '+%Y.%m.%d')" >> $GITHUB_ENV | ||
| - uses: actions/checkout@v4 | ||
| - name: check-version-tag | ||
| shell: bash | ||
| run: | | ||
| git fetch --tags --force | ||
| git show-ref --tags --verify --quiet -- "refs/tags/${{ env.VERSION }}" && echo "VERSION=$(date '+%Y.%m.%d-%H.%M')" >> $GITHUB_ENV || exit 0 | ||
| - name: create-update-branch | ||
| uses: peterjgrainger/action-create-branch@v3.0.0 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Download source | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| branch: "${{ env.BRANCH_PREFIX }}${{ env.VERSION }}" | ||
| - uses: actions/checkout@v3 | ||
| branch: main | ||
| - name: Install best-of-generator | ||
| run: pip install git+https://github.com/ProperDocs/best-of-generator | ||
| - name: Generate best-of list | ||
| run: best-of generate projects.yaml --github-key=${{ secrets.GITHUB_TOKEN }} | ||
| - name: Create Pull Request | ||
| uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 | ||
| with: | ||
| fetch-depth: 0 | ||
| ref: ${{ env.BRANCH_PREFIX }}${{ env.VERSION }} | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: install best-of-generator | ||
| run: pip install git+https://github.com/mkdocs/best-of-generator | ||
| - name: update-best-of-list | ||
| run: best-of generate projects.yaml --github-key=${{ secrets.GITHUB_TOKEN }} --libraries-key=${{ secrets.LIBRARIES_KEY }} | ||
| - name: push-update | ||
| uses: stefanzweifel/git-auto-commit-action@v5 | ||
| with: | ||
| branch: ${{ env.BRANCH_PREFIX }}${{ env.VERSION }} | ||
| commit_user_name: best-of update | ||
| commit_user_email: actions@github.com | ||
| commit_message: Update best-of list for version ${{ env.VERSION }} | ||
| tagging_message: ${{ env.VERSION }} | ||
| skip_dirty_check: true | ||
| commit_options: "--allow-empty" | ||
| - name: create-pull-request | ||
| shell: bash | ||
| run: | | ||
| # Stops script execution if a command has an error | ||
| set -e | ||
| curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.2 | ||
| bin/hub pull-request -b ${{ env.DEFAULT_BRANCH }} -h ${{ env.BRANCH_PREFIX }}${{ env.VERSION }} --no-edit -m "Best-of update: ${{ env.VERSION }}" -m "To finish this update: Select <code>Merge pull request</code> below and <code>Confirm merge</code>. Also, make sure to publish the created draft release in the [releases section](../releases) as well." || true | ||
| rm bin/hub | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| # - name: create-release | ||
| # uses: softprops/action-gh-release@v2 | ||
| # env: | ||
| # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| # with: | ||
| # tag_name: ${{ env.VERSION }} | ||
| # name: "Update: ${{ env.VERSION }}" | ||
| # body_path: "latest-changes.md" | ||
| # draft: true | ||
| # prerelease: false | ||
| add-paths: README.md | ||
| commit-message: 'Update best-of list' | ||
| title: 'Update best-of list' | ||
| committer: 'github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>' | ||
| author: 'github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>' | ||
| branch: update | ||
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
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
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like making PRs only creates extra noise and work for us here, unless you setup some form of auto-merge after a time without review?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just in case the system produces garbage/ empty results. Maybe it needs actual review. At least at first
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just fear that this will create a lot of extra work for us in the future.
But for now is this probs the best to do I suppose.
Maybe have assignees configured tho, so that we are notified to check the PR?