Skip to content

Commit

Permalink
Merge pull request #6 from urcomputeringpal/jnewland-patch-1
Browse files Browse the repository at this point in the history
Run tests on push, cleanup docs
  • Loading branch information
jnewland authored Jun 17, 2023
2 parents 53da27d + 449aff6 commit b13ac22
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 9 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Test
on: # rebuild any PRs and main branch changes
pull_request:
push:
branches:
- main
- 'releases/*'

jobs:
test: # make sure build/ci work properly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
npm install
- run: |
npm run all
demo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
label-prefix: demo
pulumi-output: |
1 to update
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Pulumi Preview PR Label Action

Decorate your PR with context Pulumi Preview output
Decorate your PR with context from Pulumi Preview output.

See [./action.yml](./action.yml) for the full documentation for this action's inputs and outputs.

Expand Down
6 changes: 3 additions & 3 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test('only some', async () => {
`

const labels = await computeLabels(pulumiOutput, 'production')
expect(labels.add).toContain('production changes')
expect(labels.add).toContain('production updates')
expect(labels.add).toContain('production replacements')
expect(labels.remove).toContain('production creations')
expect(labels.remove).toContain('production deletions')
Expand All @@ -24,7 +24,7 @@ test('all', async () => {
`

const labels = await computeLabels(pulumiOutput, 'production')
expect(labels.add).toContain('production changes')
expect(labels.add).toContain('production updates')
expect(labels.add).toContain('production replacements')
expect(labels.add).toContain('production creations')
expect(labels.add).toContain('production deletions')
Expand All @@ -36,7 +36,7 @@ test('noop', async () => {
`

const labels = await computeLabels(pulumiOutput, 'production')
expect(labels.remove).toContain('production changes')
expect(labels.remove).toContain('production updates')
expect(labels.remove).toContain('production replacements')
expect(labels.remove).toContain('production creations')
expect(labels.remove).toContain('production deletions')
Expand Down
4 changes: 2 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/labels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ export async function computeLabels(
}

if (pulumiOutput.match('[1-9]* to update')) {
labels.add.push(`${labelPrefix} changes`)
labels.add.push(`${labelPrefix} updates`)
} else {
labels.remove.push(`${labelPrefix} changes`)
labels.remove.push(`${labelPrefix} updates`)
}

if (pulumiOutput.match('[1-9]* to replace')) {
Expand Down

0 comments on commit b13ac22

Please sign in to comment.