Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config: workflow ordering #18

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
name: "Build and populate cache"
on:
pull_request:
push:
branches:
- main
schedule:
- cron: '51 2 * * *'
types: [labeled]

jobs:
tests:
if: ${{ github.event.label.name == 'formatted' }}
strategy:
matrix:
cachixName:
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
pull-requests: write

steps:
- name: Checkout repository
Expand All @@ -28,3 +29,15 @@ jobs:
with:
commit_message: "treewide: nixfmt formatting"
branch: ${{ github.head_ref }}
- name: Add label
uses: actions/github-script@v6
with:
github-token: "${{ secrets.PAT }}"
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["formatted"]
})