Skip to content

Commit a10e2e1

Browse files
committed
add autofix_started action output, fix #6
1 parent 8caa572 commit a10e2e1

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@ This repository contains the **autofix.ci** GitHub Action.
77
1. Install the [autofix.ci GitHub App](https://autofix.ci) for your repository.
88
2. Add this action at the end of your code-formatting CI job.
99
See [autofix.ci/setup](https://autofix.ci/setup) for examples!
10+
11+
## Customization
12+
13+
See [action.yml](./action.yml) for a list of all the available inputs and outputs.
14+
You can pass inputs like this:
15+
16+
```yaml
17+
- uses: autofix-ci/action@hash
18+
with:
19+
fail-fast: false
20+
```
21+
1022
## Badge
1123
1224
[![autofix enabled](https://shields.io/badge/autofix.ci-yes-success?logo=data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjZmZmIiB2aWV3Qm94PSIwIDAgMTI4IDEyOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCB0cmFuc2Zvcm09InNjYWxlKDAuMDYxLC0wLjA2MSkgdHJhbnNsYXRlKC0yNTAsLTE3NTApIiBkPSJNMTMyNSAtMzQwcS0xMTUgMCAtMTY0LjUgMzIuNXQtNDkuNSAxMTQuNXEwIDMyIDUgNzAuNXQxMC41IDcyLjV0NS41IDU0djIyMHEtMzQgLTkgLTY5LjUgLTE0dC03MS41IC01cS0xMzYgMCAtMjUxLjUgNjJ0LTE5MSAxNjl0LTkyLjUgMjQxcS05MCAxMjAgLTkwIDI2NnEwIDEwOCA0OC41IDIwMC41dDEzMiAxNTUuNXQxODguNSA4MXExNSA5OSAxMDAuNSAxODAuNXQyMTcgMTMwLjV0MjgyLjUgNDlxMTM2IDAgMjU2LjUgLTQ2IHQyMDkgLTEyNy41dDEyOC41IC0xODkuNXExNDkgLTgyIDIyNyAtMjEzLjV0NzggLTI5OS41cTAgLTEzNiAtNTggLTI0NnQtMTY1Lj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AtNTlxLTM0IDI5IC01NCA2NS41dC0yNSA4MS41cS04MSAtMTggLTE0NSAtNzB0LTEwMSAtMTI1LjV0LTM3IC0xNTguNXEwIC0xMDIgNDguNSAtMTgwLjV0MTI5LjUgLTEyM3QxNzkgLTQ0LjV6Ii8+PC9zdmc+)](https://autofix.ci)

action.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ branding:
44
icon: 'check-circle'
55
color: 'green'
66
runs:
7-
using: 'node16'
7+
using: 'node20'
88
main: 'index.js'
99
inputs:
1010
fail-fast:
@@ -14,3 +14,8 @@ inputs:
1414
commit-message:
1515
description: 'The commit message to use when fixing a commit.'
1616
required: false
17+
outputs:
18+
autofix_started:
19+
description: |
20+
Boolean indicating whether changes have been sent to the autofix server
21+
and a fix commit is coming up.

index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ const fs = require("fs");
66

77
async function run() {
88
try {
9+
core.setOutput('autofix_started', false);
10+
911
if (process.env.GITHUB_WORKFLOW !== "autofix.ci") {
1012
throw new Error(`For security reasons, the workflow in which the autofix.ci action is used must be named "autofix.ci".`);
1113
}
@@ -103,6 +105,7 @@ async function run() {
103105
const body = await resp.readBody();
104106
if (resp.message.statusCode === 200) {
105107
core.setFailed("✅ Autofix task started.");
108+
core.setOutput('autofix_started', true);
106109
} else {
107110
console.log(resp.message.statusCode, body);
108111
core.setFailed(body);

0 commit comments

Comments
 (0)