Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
szapp committed Sep 15, 2024
1 parent 400dad7 commit 35d24de
Showing 1 changed file with 40 additions and 7 deletions.
47 changes: 40 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,24 @@ The action superficially parses Daedalus script files (based off of a source fil
## Usage

Create a new GitHub Actions workflow in your project, e.g. at `.github/workflows/ou.yml`.
The content of the file should be in the following format:
The content of the file should be in the following format.
Two optional additional steps are added to illustrate committing the generated file or providing it for download.

```yaml
name: ou

# Trigger workflow manually
# Trigger workflow manually and on push events with changes in SRC or D files
on:
workflow_dispatch:
push:
paths:
- '**.src'
- '**.SRC'
- '**.d'
- '**.D'

permissions:
contents: write

# The checkout action needs to be run first
jobs:
Expand All @@ -28,23 +38,46 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Generate output units
id: ou
uses: szapp/output-unit-action@v1
with:
srcFile: path/to/Gothic.src # Adjust
outFile: path/to/OU.csl # Adjust
srcFile: path/to/Gothic.src # Adjust <--
outFile: path/to/OU.csl # Adjust <--

# Optional: If pushed, commit updated file if it changed
- name: Commit file to repository if changed
if: github.event_name == 'push' && steps.ou.outputs.changed == 'true'
run: |
git config user.name $(git log -1 --format=%an)
git config user.email $(git log -1 --format=%ae)
git add .
git commit -m "Update output units"
git push
# Continue with the file path/to/OU.csl, e.g.
# - Commit it to the repository
# - Provide it as workflow artifact for download
# Optional: If manually triggered, provide as artifact for download
- name: Upload file as artifact
if: github.event_name == 'workflow_dispatch'
uses: actions/upload-artifact@v4
with:
name: Output Units
path: path/to/OU.csl # Adjust <--
overwrite: true
```
## Configuration
### Inputs
- `srcFile`:
Path to Daedalus source file (e.g. `path/to/Gothic.src`) listing relevant scripts.
Required.

- `outFile`:
Path to output file (e.g. `path/to/OU.csl`).
Required.

### Outputs

- `changed`:
Whether or not the output units changed in comparison to an existing `outFile`.
This output can be accessed by subsequent steps as seen in the example above.

0 comments on commit 35d24de

Please sign in to comment.