From 3ef419b3f0eccc3e82450578d477e4cb9dcc18e0 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Mon, 5 Jul 2021 03:39:44 +0100 Subject: [PATCH] fix(meta): update meta along with casks It turns out push events are not triggered when commits are created by github actions via the GitHub API. So let's simplify things and just update the meta branch in the same workflow that updates the casks themselves. --- .github/workflows/update-casks.yml | 37 +++++++++++++++++++++++++++ .github/workflows/update-meta.yml | 40 ------------------------------ 2 files changed, 37 insertions(+), 40 deletions(-) delete mode 100644 .github/workflows/update-meta.yml diff --git a/.github/workflows/update-casks.yml b/.github/workflows/update-casks.yml index c7fece9d..86594348 100644 --- a/.github/workflows/update-casks.yml +++ b/.github/workflows/update-casks.yml @@ -1,5 +1,6 @@ --- name: Update Casks +concurrency: jimeh/homebrew-emacs-builds/update-casks on: schedule: - cron: "0 3 * * *" @@ -59,3 +60,39 @@ jobs: livecheck-results.json env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + update-meta: + runs-on: macos-10.15 + needs: [update-casks] + steps: + - name: Checkout tap repository main branch + uses: actions/checkout@v2 + with: + path: tap + - name: Symlink homebrew tap + run: | + mkdir -p "$(brew --repo)/Library/Taps/jimeh" + ln -s "${{ github.workspace }}/tap" \ + "$(brew --repo)/Library/Taps/jimeh/homebrew-emacs-builds" + - name: Checkout tap repository meta branch + uses: actions/checkout@v2 + with: + ref: meta + path: meta + - name: Install meta dependencies + run: brew bundle + working-directory: meta + - name: Update meta files + run: make update + working-directory: meta + - name: commit and push changes to meta branch + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: "chore(meta): update meta files" + repository: meta + branch: meta + commit_user_name: github-actions[bot] + commit_user_email: github-actions[bot]@users.noreply.github.com + commit_author: >- + github-actions[bot] + skip_dirty_check: false diff --git a/.github/workflows/update-meta.yml b/.github/workflows/update-meta.yml deleted file mode 100644 index 76396364..00000000 --- a/.github/workflows/update-meta.yml +++ /dev/null @@ -1,40 +0,0 @@ ---- -name: Update Meta -on: [push] -concurrency: jimeh/homebrew-emacs-builds/update-meta - -jobs: - update-meta: - runs-on: macos-10.15 - if: github.ref == 'refs/heads/main' - steps: - - name: Checkout tap repository main branch - uses: actions/checkout@v2 - with: - path: tap - - name: Symlink homebrew tap - run: | - mkdir -p "$(brew --repo)/Library/Taps/jimeh" - ln -s "${{ github.workspace }}/tap" \ - "$(brew --repo)/Library/Taps/jimeh/homebrew-emacs-builds" - - name: Checkout tap repository meta branch - uses: actions/checkout@v2 - with: - ref: meta - path: meta - - name: Install meta dependencies - run: brew bundle - working-directory: meta - - name: Update meta files - run: make update - working-directory: meta - - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: "chore(meta): update meta files" - repository: meta - branch: meta - commit_user_name: github-actions[bot] - commit_user_email: github-actions[bot]@users.noreply.github.com - commit_author: >- - github-actions[bot] - skip_dirty_check: false