Skip to content

Commit

Permalink
ci: Automatically update dist files on every push (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
simenandre authored Mar 17, 2021
1 parent 5f678ed commit 83390f3
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn build && git add dist/* && yarn lint-staged
yarn lint-staged
25 changes: 25 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Check for updated dist files
on:
pull_request:

jobs:
check-if-dist-changed:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
dist:
- 'dist/**'
- uses: mshick/add-pr-comment@v1
if: steps.changes.outputs.dist == 'true'
with:
message: |
Hi 👋
Thank you for this contribution!
Due to security reasons, we only allow updating the `dist/**` files with our own workflows.
repo-token: ${{ secrets.PULUMI_BOT_TOKEN }}
repo-token-user-login: pulumi-bot
2 changes: 2 additions & 0 deletions .github/workflows/smoke_test_cli_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:
working-directory: .github/test-stacks/dotnet
env:
PULUMI_CONFIG_PASSPHRASE: not-a-secret
- run: yarn install
- run: yarn build
- uses: ./
env:
PULUMI_CONFIG_PASSPHRASE: not-a-secret
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
working-directory: .github/test-stacks/golang
env:
PULUMI_CONFIG_PASSPHRASE: not-a-secret
- run: yarn install
- run: yarn build
- uses: ./
if: always()
id: pulumi
Expand All @@ -55,6 +57,8 @@ jobs:
working-directory: .github/test-stacks/golang
env:
PULUMI_CONFIG_PASSPHRASE: not-a-secret
- run: yarn install
- run: yarn build
- uses: ./
if: always()
env:
Expand All @@ -80,6 +84,8 @@ jobs:
working-directory: .github/test-stacks/golang
env:
PULUMI_CONFIG_PASSPHRASE: not-a-secret
- run: yarn install
- run: yarn build
- uses: ./
if: always()
env:
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/update_dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Update dist files
on:
push:
branches:
- main
- master

jobs:
update-dist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: yarn install
- run: yarn build
- uses: stefanzweifel/git-auto-commit-action@v4
with:
file_pattern: dist/**
commit_message: 'chore(dist): Update dist [automated commit]'
commit_user_name: Pulumi Bot
commit_user_email: pulumi-bot@users.noreply.github.com
2 changes: 2 additions & 0 deletions .github/workflows/workflow_dotnet_application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
working-directory: .github/test-stacks/dotnet
env:
PULUMI_CONFIG_PASSPHRASE: not-a-secret
- run: yarn install
- run: yarn build
- uses: ./
env:
PULUMI_CONFIG_PASSPHRASE: not-a-secret
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/workflow_go_application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
working-directory: .github/test-stacks/golang
env:
PULUMI_CONFIG_PASSPHRASE: not-a-secret
- run: yarn install
- run: yarn build
- uses: ./
env:
PULUMI_CONFIG_PASSPHRASE: not-a-secret
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/workflow_nodejs_application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:
PULUMI_CONFIG_PASSPHRASE: not-a-secret
- run: npm install
working-directory: .github/test-stacks/nodejs
- run: yarn install
- run: yarn build
- uses: ./
env:
PULUMI_CONFIG_PASSPHRASE: not-a-secret
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/workflow_python_application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:
PULUMI_CONFIG_PASSPHRASE: not-a-secret
- run: pip install -r requirements.txt
working-directory: .github/test-stacks/python
- run: yarn install
- run: yarn build
- uses: ./
env:
PULUMI_CONFIG_PASSPHRASE: not-a-secret
Expand Down
5 changes: 0 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
"{.eslintrc}": "prettier --write",
"*.md": "prettier --write"
},
"husky": {
"hooks": {
"pre-commit": "yarn build && git add dist/* && lint-staged"
}
},
"devDependencies": {
"@types/faker": "^5.1.7",
"@types/jest": "~26.0.20",
Expand Down

0 comments on commit 83390f3

Please sign in to comment.