Recreate action #1250
This file contains 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: Recreate action | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 5 * * *' | |
jobs: | |
build: | |
name: Recreate action | |
runs-on: ubuntu-latest | |
if: ${{ github.repository_owner == 'Armbian' }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. | |
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. | |
- name: Create local changes | |
run: | | |
wget https://www.armbian.com/userdata.csv | |
cat userdata.csv | cut -d"/" -f1 | uniq | sed 's/.*/ - board: &/' > .github/workflows/boards.txt | |
sed '/include/r.github/workflows/boards.txt' .github/workflows/mirror-purge.template > .github/workflows/mirror-purge.yml | |
sed '/include/r.github/workflows/boards.txt' .github/workflows/mirror-sync.template > .github/workflows/mirror-sync.yml | |
git add .github/workflows/mirror-purge.yml | |
git add .github/workflows/mirror-sync.yml | |
- name: Commit files | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "Armbianworker" | |
git commit --allow-empty -m "Update github actions" -a | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.MIRROR }} | |
branch: ${{ github.ref }} |