Skip to content

Commit 714925a

Browse files
authored
Merge pull request #225 from salesforcecli/phale/gha
fix: add GHA folder
2 parents 9105521 + c3cd0e9 commit 714925a

File tree

10 files changed

+211
-0
lines changed

10 files changed

+211
-0
lines changed

.github/dependabot.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: 'npm'
4+
directory: '/'
5+
schedule:
6+
interval: 'weekly'
7+
day: 'saturday'
8+
versioning-strategy: 'increase'
9+
labels:
10+
- 'dependencies'
11+
open-pull-requests-limit: 5
12+
pull-request-branch-name:
13+
separator: '-'
14+
commit-message:
15+
# cause a release for non-dev-deps
16+
prefix: fix(deps)
17+
# no release for dev-deps
18+
prefix-development: chore(dev-deps)
19+
ignore:
20+
- dependency-name: '@salesforce/dev-scripts'
21+
- dependency-name: '*'
22+
update-types: ['version-update:semver-major']

.github/workflows/automerge.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: automerge
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: '42 2,5,8,11 * * *'
6+
7+
jobs:
8+
automerge:
9+
uses: salesforcecli/github-workflows/.github/workflows/automerge.yml@main
10+
secrets: inherit

.github/workflows/devScripts.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: devScripts
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: '50 6 * * 0'
6+
7+
jobs:
8+
update:
9+
uses: salesforcecli/github-workflows/.github/workflows/devScriptsUpdate.yml@main
10+
secrets: inherit
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: failureNotifications
2+
3+
on:
4+
workflow_run:
5+
workflows:
6+
- version, tag and github release
7+
- publish
8+
types:
9+
- completed
10+
11+
jobs:
12+
failure-notify:
13+
runs-on: ubuntu-latest
14+
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
15+
steps:
16+
- name: Announce Failure
17+
id: slack
18+
uses: slackapi/slack-github-action@v1.21.0
19+
env:
20+
# for non-CLI-team-owned plugins, you can send this anywhere you like
21+
SLACK_WEBHOOK_URL: ${{ secrets.CLI_ALERTS_SLACK_WEBHOOK }}
22+
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
23+
with:
24+
# Payload can be visually tested here: https://app.slack.com/block-kit-builder/T01GST6QY0G#%7B%22blocks%22:%5B%5D%7D
25+
# Only copy over the "blocks" array to the Block Kit Builder
26+
payload: |
27+
{
28+
"text": "Workflow \"${{ github.event.workflow_run.name }}\" failed in ${{ github.event.workflow_run.repository.name }}",
29+
"blocks": [
30+
{
31+
"type": "header",
32+
"text": {
33+
"type": "plain_text",
34+
"text": ":bh-alert: Workflow \"${{ github.event.workflow_run.name }}\" failed in ${{ github.event.workflow_run.repository.name }} :bh-alert:"
35+
}
36+
},
37+
{
38+
"type": "section",
39+
"text": {
40+
"type": "mrkdwn",
41+
"text": "*Repo:* ${{ github.event.workflow_run.repository.html_url }}\n*Workflow name:* `${{ github.event.workflow_run.name }}`\n*Job url:* ${{ github.event.workflow_run.html_url }}"
42+
}
43+
}
44+
]
45+
}

.github/workflows/manualRelease.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: manual release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
release:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
with:
12+
token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
13+
- name: Conventional Changelog Action
14+
id: changelog
15+
uses: TriPSs/conventional-changelog-action@d360fad3a42feca6462f72c97c165d60a02d4bf2
16+
# overriding some of the basic behaviors to just get the changelog
17+
with:
18+
git-user-name: svc-cli-bot
19+
git-user-email: svc_cli_bot@salesforce.com
20+
github-token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
21+
output-file: false
22+
# always do the release, even if there are no semantic commits
23+
skip-on-empty: false
24+
tag-prefix: ''
25+
- uses: notiz-dev/github-action-json-property@2192e246737701f108a4571462b76c75e7376216
26+
id: packageVersion
27+
with:
28+
path: 'package.json'
29+
prop_path: 'version'
30+
- name: Create Github Release
31+
uses: actions/create-release@v1
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
34+
with:
35+
tag_name: ${{ steps.packageVersion.outputs.prop }}
36+
release_name: ${{ steps.packageVersion.outputs.prop }}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Pull Request Slack Notification
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Notify Slack on PR open
12+
env:
13+
WEBHOOK_URL: ${{ secrets.CLI_TEAM_SLACK_WEBHOOK_URL }}
14+
PULL_REQUEST_AUTHOR_ICON_URL: ${{ github.event.pull_request.user.avatar_url }}
15+
PULL_REQUEST_AUTHOR_NAME: ${{ github.event.pull_request.user.login }}
16+
PULL_REQUEST_AUTHOR_PROFILE_URL: ${{ github.event.pull_request.user.html_url }}
17+
PULL_REQUEST_BASE_BRANCH_NAME: ${{ github.event.pull_request.base.ref }}
18+
PULL_REQUEST_COMPARE_BRANCH_NAME: ${{ github.event.pull_request.head.ref }}
19+
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
20+
PULL_REQUEST_REPO: ${{ github.event.pull_request.head.repo.name }}
21+
PULL_REQUEST_TITLE: ${{ github.event.pull_request.title }}
22+
PULL_REQUEST_URL: ${{ github.event.pull_request.html_url }}
23+
uses: salesforcecli/github-workflows/.github/actions/prNotification@main

.github/workflows/onPushToMain.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# test
2+
name: version, tag and github release
3+
4+
on:
5+
push:
6+
branches: [main, v2]
7+
8+
jobs:
9+
release:
10+
uses: salesforcecli/github-workflows/.github/workflows/githubRelease.yml@main
11+
secrets: inherit
12+
13+
# most repos won't use this
14+
# depends on previous job to avoid git collisions, not for any functionality reason
15+
# docs:
16+
# uses: salesforcecli/github-workflows/.github/workflows/publishTypedoc.yml@main
17+
# secrets: inherit
18+
# needs: release

.github/workflows/onRelease.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: publish
2+
3+
on:
4+
release:
5+
types: [released]
6+
# support manual release in case something goes wrong and needs to be repeated or tested
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: tag that needs to publish
11+
type: string
12+
required: true
13+
jobs:
14+
npm:
15+
uses: salesforcecli/github-workflows/.github/workflows/npmPublish.yml@main
16+
with:
17+
# ternary-ish https://github.com/actions/runner/issues/409#issuecomment-752775072
18+
# if the version is 2.x we release it on the `sf` dist tag
19+
tag: ${{ startsWith( github.event.release.tag_name || inputs.tag, '1.') && 'latest' || 'sf'}}
20+
githubTag: ${{ github.event.release.tag_name || inputs.tag }}
21+
secrets: inherit

.github/workflows/test.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: tests
2+
on:
3+
push:
4+
branches-ignore: [main, v2]
5+
workflow_dispatch:
6+
7+
jobs:
8+
yarn-lockfile-check:
9+
uses: salesforcecli/github-workflows/.github/workflows/lockFileCheck.yml@main
10+
linux-unit-tests:
11+
needs: yarn-lockfile-check
12+
uses: salesforcecli/github-workflows/.github/workflows/unitTestsLinux.yml@main
13+
windows-unit-tests:
14+
needs: linux-unit-tests
15+
uses: salesforcecli/github-workflows/.github/workflows/unitTestsWindows.yml@main

.github/workflows/validate-pr.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: pr-validation
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, edited]
6+
# only applies to PRs that want to merge to main and v2
7+
branches: [main, v2]
8+
9+
jobs:
10+
pr-validation:
11+
uses: salesforcecli/github-workflows/.github/workflows/validatePR.yml@main

0 commit comments

Comments
 (0)