From 1b22c124ab9b042cba851ac6d1ae679414ef1aaf Mon Sep 17 00:00:00 2001 From: fmway Date: Wed, 1 Jan 2025 23:38:45 +0700 Subject: [PATCH 1/2] chore(actions): bjir --- .github/workflows/ci.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f333b11..9460e39 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,16 +59,6 @@ jobs: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} run: | gh pr create --title "Merge from nixos-unstable" --body "" -l "automated" - - uses: DeterminateSystems/magic-nix-cache-action@main - with: - use-flakehub: false - - uses: cachix/cachix-action@master - with: - name: fmcachix - # If you chose API tokens for write access OR if you have a private cache - authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - - run: nix build .#llvm --verbose - - run: nix-collect-garbage -d wasmer: if: "${{ github.event_name == 'pull_request' }}" runs-on: ubuntu-latest From 64f2723654435f165696611045791f765b7dd069 Mon Sep 17 00:00:00 2001 From: fmway Date: Wed, 1 Jan 2025 23:43:53 +0700 Subject: [PATCH 2/2] chore(actions): split pr to other workflows --- .github/workflows/ci.yml | 39 ----------------------------------- .github/workflows/pr.yml | 44 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 39 deletions(-) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9460e39..fca2bee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,8 +3,6 @@ on: pull_request: push: branches: [master] - schedule: - - cron: "0 */2 * * *" workflow_call: inputs: config-path: @@ -22,43 +20,6 @@ on: permissions: write-all jobs: - auto-pull-request: - if: "${{ github.event_name == 'schedule' }}" - runs-on: [ ubuntu-latest ] - steps: - - uses: actions/checkout@v4 - with: - ref: nixos-unstable - - name: Setup git - run: | - git config --global user.name 'little fmway' - git config --global user.email 'fm18lv@gmail.com' - git remote set-url origin https://x-access-token:${{ secrets.GH_TOKEN }}@github.com/$GITHUB_REPOSITORY - - name: Check if PR exists - id: check - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - tree -a - git fetch origin - prs=$(gh pr list \ - --repo "$GITHUB_REPOSITORY" \ - --head 'nixos-unstable' \ - --base 'master' \ - --json title \ - --jq 'length') - count_commit=$(git rev-list --left-right --count origin/nixos-unstable...origin/master | awk '{print $1}') - if (( prs > 0 )) || (( count_commit < 1 )); then - echo "skip=true" >> "$GITHUB_OUTPUT" - fi - - name: Create pull request - if: '!steps.check.outputs.skip' - env: - GH_TOKEN: ${{secrets.GITHUB_TOKEN}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - run: | - gh pr create --title "Merge from nixos-unstable" --body "" -l "automated" wasmer: if: "${{ github.event_name == 'pull_request' }}" runs-on: ubuntu-latest diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..2215222 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,44 @@ +name: Auto Pull Request +on: + schedule: + - cron: "0 */2 * * *" + +permissions: write-all + +jobs: + auto-pull-request: + runs-on: [ ubuntu-latest ] + steps: + - uses: actions/checkout@v4 + with: + ref: nixos-unstable + - name: Setup git + run: | + git config --global user.name 'little fmway' + git config --global user.email 'fm18lv@gmail.com' + git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY + - name: Check if PR exists + id: check + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + tree -a + git fetch origin + prs=$(gh pr list \ + --repo "$GITHUB_REPOSITORY" \ + --head 'nixos-unstable' \ + --base 'master' \ + --json title \ + --jq 'length') + count_commit=$(git rev-list --left-right --count origin/nixos-unstable...origin/master | awk '{print $1}') + if (( prs > 0 )) || (( count_commit < 1 )); then + echo "skip=true" >> "$GITHUB_OUTPUT" + fi + - name: Create pull request + if: '!steps.check.outputs.skip' + env: + GH_TOKEN: ${{secrets.GITHUB_TOKEN}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + run: | + gh pr create --title "Merge from nixos-unstable" --body "" -l "automated"