Skip to content

Commit 299d1fc

Browse files
committed
Trial run of air workflows
1 parent af02bda commit 299d1fc

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Workflow derived from https://github.com/posit-dev/air-action/tree/main/examples
2+
on:
3+
push:
4+
branches: [main, master]
5+
pull_request:
6+
7+
name: air-format-check.yaml
8+
9+
permissions: read-all
10+
11+
jobs:
12+
format-check:
13+
name: format-check
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Format check
19+
uses: posit-dev/air-action@main
20+
with:
21+
args: format . --check
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Workflow derived from https://github.com/posit-dev/air-action/tree/main/examples
2+
on:
3+
issue_comment:
4+
types: [created]
5+
6+
name: air-pr-commands.yaml
7+
8+
permissions: read-all
9+
10+
jobs:
11+
# Triggered by a `/format` comment
12+
format:
13+
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/format') }}
14+
name: format
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Fetch
22+
uses: r-lib/actions/pr-fetch@v2
23+
with:
24+
repo-token: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: Format
27+
uses: posit-dev/air-action@main
28+
with:
29+
args: format .
30+
31+
- name: Commit
32+
run: |
33+
git config --local user.name "$GITHUB_ACTOR"
34+
git config --local user.email "[email protected]"
35+
git add \*.R
36+
git commit -m 'Format'
37+
38+
- name: Push
39+
uses: r-lib/actions/pr-push@v2
40+
with:
41+
repo-token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)