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

Add composite action #3

Closed
wants to merge 1 commit 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
14 changes: 14 additions & 0 deletions .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Test action

on:
pull_request:
branches: [trunk]

jobs:
runs-on: ubuntu-latest
steps:
- name: Install ghelper
uses: 3lvia/ghelper@feat/action

- name: Run ghelper
run: ghelper exec -x 'cat LICENSE' 3lvia/ghelper
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,22 @@ Examples:
3. Run a custom shell script on the repositories listed in 'repositories.txt', and don't clean up the working directory:
ghelper exec -x 'sh ./my-script.sh' -w /home/user/my-working-dir repositories.txt
```

### Usage in GitHub Actions

```yaml
name: ghelper

on:
pull_request:
branches: [trunk]

jobs:
runs-on: ubuntu-latest
steps:
- name: Install ghelper
uses: 3lvia/ghelper@trunk

- name: Run ghelper
run: ghelper exec -x 'cat LICENSE' 3lvia/ghelper
```
18 changes: 18 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: 'Install ghelper'
description: 'Install ghelper to use in your workflow.'

runs:
using: 'composite'
steps:
- name: Checkout ghelper repository
uses: actions/checkout@v4
with:
repository: '3lvia/ghelper'
path: '/tmp/ghelper'

- name: Install ghelper
shell: bash
run: |
cp /tmp/ghelper/ghelper /usr/local/bin/ghelper
chmod +x /usr/local/bin/ghelper
rm -rf /tmp/ghelper