Skip to content

Commit 5b8c1f4

Browse files
authored
Initial commit
0 parents  commit 5b8c1f4

File tree

6 files changed

+207
-0
lines changed

6 files changed

+207
-0
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @actions/actions-runtime

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: daily

.github/workflows/test.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
workflow_dispatch:
9+
10+
jobs:
11+
test-bash:
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
# Runs on all supported runners
16+
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
17+
os: [ ubuntu-22.04, ubuntu-20.04, ubuntu-18.04, windows-2022, windows-2019, macos-11, macos-10.15 ]
18+
runs-on: ${{ matrix.os }}
19+
timeout-minutes: 5
20+
defaults:
21+
run:
22+
shell: bash
23+
24+
steps:
25+
- uses: actions/checkout@v3
26+
27+
- id: without-parameters
28+
uses: ./
29+
- run: test "${GREET}" = "Hello World"
30+
env:
31+
GREET: ${{ steps.without-parameters.outputs.greet }}
32+
- run: test "$(cat greet.txt)" = "Hello World"
33+
34+
- id: with-parameters
35+
uses: ./
36+
with:
37+
who-to-greet: composite action
38+
- run: test "${GREET}" = "Hello composite action"
39+
env:
40+
GREET: ${{ steps.with-parameters.outputs.greet }}
41+
- run: test "$(cat greet.txt)" = "Hello composite action"
42+
43+
test-powershell:
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
os: [ windows-2022, windows-2019 ]
48+
runs-on: ${{ matrix.os }}
49+
timeout-minutes: 5
50+
51+
steps:
52+
- uses: actions/checkout@v3
53+
54+
- id: without-parameters
55+
uses: ./
56+
- run: test "${env:GREET}" = "Hello World"
57+
env:
58+
GREET: ${{ steps.without-parameters.outputs.greet }}
59+
- run: test "$(cat greet.txt)" = "Hello World"
60+
61+
- id: with-parameters
62+
uses: ./
63+
with:
64+
who-to-greet: composite action
65+
- run: test "${env:GREET}" = "Hello composite action"
66+
env:
67+
GREET: ${{ steps.with-parameters.outputs.greet }}
68+
- run: test "$(cat greet.txt)" = "Hello composite action"
69+
70+
# Make up matrix statuses into a status for status checks in branch protection rules
71+
test-passing:
72+
needs: [ test-bash, test-powershell ]
73+
runs-on: ubuntu-latest
74+
timeout-minutes: 1
75+
76+
steps:
77+
- run: echo "All tests have passed."

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 snow-actions
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
[![Test](https://github.com/snow-actions/composite-action-template/actions/workflows/test.yml/badge.svg)](https://github.com/snow-actions/composite-action-template/actions/workflows/test.yml)
2+
3+
# Create a Composite Action
4+
5+
Click the `Use this template` to bootstrap the creation of a [composite action](https://docs.github.com/en/actions/creating-actions/creating-a-composite-action).:rocket:
6+
7+
This template includes tests, a validation workflow and versioning guidance.
8+
9+
Learn how to use this template at [Wiki](https://github.com/snow-actions/composite-action-template/wiki).
10+
11+
## Usage
12+
13+
### Basic
14+
15+
```yml
16+
steps:
17+
- uses: snow-actions/[email protected]
18+
```
19+
20+
### Optional
21+
22+
```yml
23+
steps:
24+
- uses: snow-actions/[email protected]
25+
with:
26+
who-to-greet: Your name
27+
```
28+
29+
## Environment variables
30+
31+
| Name | Description | Default | Required |
32+
| - | - | - | - |
33+
| `WHO_TO_GREET` | Who to greet | `World` | no |
34+
35+
## Inputs
36+
37+
See [action.yml](action.yml)
38+
39+
| Name | Description | Default | Required |
40+
| - | - | - | - |
41+
| `who-to-greet` | Who to greet | `World` | yes |
42+
43+
## Outputs
44+
45+
See [action.yml](action.yml)
46+
47+
| Name | Description |
48+
| - | - |
49+
| `greet` | The word we greeted you |
50+
51+
## Supported
52+
53+
### Runners
54+
55+
- `ubuntu-*`
56+
- `windows-*`
57+
- `macos-*`
58+
- `self-hosted`
59+
60+
### Events
61+
62+
- Any
63+
<!--
64+
- `push`
65+
- `pull_request`
66+
-->
67+
68+
## Dependencies
69+
70+
- Bash
71+
- [actions/cache](https://github.com/actions/cache) >= 3.0.0
72+
- [GitHub CLI](https://cli.github.com/) >= 2.6.0
73+
74+
## Contributing
75+
76+
Welcome.

action.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Composite Action Template
2+
description: Get started with Composite actions
3+
branding:
4+
icon: award
5+
color: green
6+
inputs:
7+
who-to-greet:
8+
description: Who to greet
9+
required: true
10+
default: World
11+
outputs:
12+
greet:
13+
description: The word we greeted you
14+
value: ${{ steps.greet.outputs.word }}
15+
runs:
16+
using: composite
17+
steps:
18+
- id: greet
19+
run: |
20+
GREET="Hello ${WHO}"
21+
echo "${GREET}"
22+
echo "${GREET}" > greet.txt
23+
echo "::set-output name=word::${GREET}"
24+
shell: bash
25+
env:
26+
WHO: ${{ inputs.who-to-greet }}

0 commit comments

Comments
 (0)