Skip to content

Commit

Permalink
Merge pull request #19 from stakater/workflow
Browse files Browse the repository at this point in the history
Switch PR workflow to pull_request
  • Loading branch information
bnallapeta committed Sep 17, 2024
2 parents 8c5de74 + 406211c commit f90a3f2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 51 deletions.
42 changes: 4 additions & 38 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Pull Request

on:
pull_request_target:
pull_request:
branches:
- main
paths-ignore:
Expand All @@ -13,12 +13,10 @@ env:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-latest
name: Build
if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"

if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
steps:

- name: Check out code
uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -48,38 +46,6 @@ jobs:
run: |
helm lint ${CHART_NAME}
# Dry run to ensure that manifests are generated successfully
#- name: Dry Run Chart
# run: |
# helm install ${CHART_NAME} ${CHART_NAME} -f ${CHART_NAME}/values.yaml -n stakater-chart-pipeline-test --dry-run --debug
# package
- name: Helm Package
run: |
helm package ${CHART_NAME}
- name: Comment on PR
uses: mshick/add-pr-comment@v1
env:
GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
with:
message: '@${{ github.actor }} Validation Successful'
allow-repeats: false

- name: Notify Failure
if: failure()
uses: mshick/add-pr-comment@v1
env:
GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
with:
message: '@${{ github.actor }} Yikes! You better fix it before anyone else finds out! [Build](https://github.com/${{ github.repository }}/commit/${{ github.event.pull_request.head.sha }}/checks) has Failed!'
allow-repeats: false

- name: Notify Slack
uses: 8398a7/action-slack@v3
if: always() # Pick up events even if the job fails or is canceled.
with:
status: ${{ job.status }}
fields: repo,author,action,eventName,ref,workflow
env:
GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }}
helm package ${CHART_NAME}
20 changes: 7 additions & 13 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Push

concurrency:
concurrency:
group: push_on_master
cancel-in-progress: false

Expand All @@ -9,7 +9,7 @@ on:
branches:
- main
paths-ignore:
- 'README.md'
- 'README.md'

env:
CHART_NAME: "rabbitmq-observability"
Expand All @@ -19,9 +19,7 @@ jobs:
name: Build
if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
runs-on: ubuntu-latest

steps:

- name: Check out code
uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -56,10 +54,6 @@ jobs:
run: |
helm lint ${CHART_NAME}
# Dry run to ensure that manifests are generated successfully
#- name: Dry Run Chart
# run: |
# helm install ${CHART_NAME} ${CHART_NAME} -f ${CHART_NAME}/values.yaml -n stakater-chart-pipeline-test --dry-run --debug
# Publish helm chart
- name: Publish Helm chart
uses: stefanprodan/helm-gh-pages@master
Expand All @@ -71,7 +65,7 @@ jobs:
charts_dir: .
charts_url: https://stakater.github.io/stakater-charts
owner: stakater
linting: off
linting: off
commit_username: stakater-user
commit_email: [email protected]

Expand All @@ -80,9 +74,9 @@ jobs:
run: |
git config --local user.email "[email protected]"
git config --local user.name "stakater-user"
git status
git status
git add rabbitmq-observability/Chart.yaml
git commit -m "[skip-ci] Update artifacts"
git commit -m "[skip-ci] Update artifacts"
# Push Chart.yaml with Updated Version
- name: Push changes
Expand Down Expand Up @@ -117,7 +111,7 @@ jobs:
fi
done
fi
- name: Push Latest Tag
uses: anothrNick/[email protected]
env:
Expand All @@ -133,4 +127,4 @@ jobs:
fields: repo,author,action,eventName,ref,workflow
env:
GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }}
SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }}

0 comments on commit f90a3f2

Please sign in to comment.