synchronize.repo-content #163
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: synchronize.repo-content | |
| on: | |
| schedule: | |
| - cron: '1 0 * * 5' | |
| workflow_dispatch: | |
| env: | |
| # todo: read it from config file | |
| OWNER: workflow-actions | |
| REF: main | |
| jobs: | |
| fetch-repo-info: | |
| name: extract repository data | |
| runs-on: ubuntu-latest | |
| # TODO: read it from filw | |
| if: github.repository != 'workflow-actions/blueprint-github-action' | |
| steps: | |
| # Step 1: run a standard checkout action, provided by github | |
| - uses: actions/checkout@v3.5.2 | |
| with: | |
| fetch-depth: '1' | |
| submodules: 'recursive' | |
| - name: fetch-repo-name | |
| shell: bash | |
| env: | |
| REPO_NAME: ${{ github.event.repository.name }} | |
| run: | | |
| echo "can we read? $GITHUB_REPOSITORY" | |
| fork-sync: | |
| name: fork-sync | |
| if: github.repository != 'workflow-actions/blueprint-github-action' | |
| needs: [fetch-repo-info] | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Step 1: run a standard checkout action, provided by github | |
| - uses: actions/checkout@v3.5.2 | |
| with: | |
| ref: ${{ env.REF }} | |
| fetch-depth: '1' | |
| submodules: 'recursive' | |
| # Step 2: Print a helpful timestamp for your records (not required, just nice) | |
| - name: timestamp | |
| id: envs | |
| run: echo "::set-output name=CURRENT_DATE::$(date -u +'%Y-%m-%dT%H-%M')" | |
| # Step 3: Display a message if 'sync' step had new commits (simple test) | |
| - uses: tgymnich/fork-sync@v1.8 | |
| with: | |
| base: main | |
| head: main | |
| owner: ${{ env.OWNER }} | |
| auto_approve: false | |
| pr_title: | | |
| 'fork: Forked from upstream "${{ github.workflow }} #${{ github.run_number }} #${{steps.envs.outputs.current_date}}" [skip ci]' | |
| pr_message: | | |
| ## Description | |
| Update current repository | |
| ## Workflow | |
| - Name: ${{ github.workflow }} | |
| - Run ID: ${{ github.run_id }} | |
| - Run Number: ${{ github.run_number }} | |
| _Auto-generated by [tgymnich/fork-sync][1]_ | |
| [1]: https://github.com/tgymnich/fork-sync | |