update awesome #3300
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 awesome | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| username: | |
| description: 'GitHub username' | |
| required: false | |
| default: 'erbanku' | |
| repository: | |
| description: 'Repository name' | |
| required: false | |
| default: 'awesome' | |
| custom_message: | |
| description: 'Custom commit message' | |
| required: false | |
| default: 'Stars update by GitHub actions' | |
| schedule: | |
| - cron: '0 0/16 * * *' | |
| jobs: | |
| awesome-stars: | |
| name: update awesome | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install starred | |
| continue-on-error: false | |
| - name: Update repo with retry | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| USERNAME: ${{ inputs.username || 'erbanku' }} | |
| REPO: ${{ inputs.repository || 'awesome' }} | |
| MESSAGE: ${{ inputs.custom_message || 'Stars update by GitHub actions' }} | |
| run: | | |
| max_attempts=3 | |
| attempt=1 | |
| until [ $attempt -gt $max_attempts ]; do | |
| echo "Attempt $attempt of $max_attempts" | |
| if starred --username ${USERNAME} --repository ${REPO} --sort --token ${GITHUB_TOKEN} --message "${MESSAGE}"; then | |
| echo "Success" | |
| exit 0 | |
| fi | |
| attempt=$((attempt + 1)) | |
| [ $attempt -le $max_attempts ] && sleep 30 | |
| done | |
| echo "Failed after $max_attempts attempts" | |
| exit 1 | |
| timeout-minutes: 10 |