Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: setups action #1

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/auto-approve.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: auto-approve
on:
pull_request_target:
types:
- labeled
- opened
- synchronize
- reopened
- ready_for_review
jobs:
approve:
runs-on: ubuntu-latest
permissions:
pull-requests: write
if: |
!github.event.pull_request.draft &&
!contains(github.event.pull_request.labels.*.name, 'do-not-merge') &&
(contains(github.event.pull_request.labels.*.name, 'auto-approve') || github.event.pull_request.user.login == 'pgollucci' || github.event.pull_request.user.login == 'p6m7g8-automation')
steps:
- uses: hmarr/auto-approve-action@v4.0.0
with:
github-token: ${{ secrets.P6_A_GH_TOKEN }}
12 changes: 12 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Build

on:
pull_request: {}
workflow_dispatch: {}

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: No-op
run: echo "This workflow intentionally does nothing and always passes."
34 changes: 34 additions & 0 deletions .github/workflows/pull-request-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: pull-request-lint
on:
pull_request_target:
types:
- labeled
- opened
- synchronize
- reopened
- ready_for_review
- edited
jobs:
validate:
name: Validate PR title
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: amannn/action-semantic-pull-request@v5.5.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |-
chore
ci
docs
feat
fix
major
perf
refactor
revert
style
test
requireScope: false
37 changes: 37 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
queue_rules:
- name: default
queue_conditions:
- base = main
- "#approved-reviews-by>=1"
- -label~=(do-not-merge)
- status-success=auto-approve
merge_conditions: []
commit_message_template: |-
{{ title }} (#{{ number }})

{{ body }}
merge_method: squash

pull_request_rules:
- name: Label core contributions
actions:
label:
add:
- contribution/core
conditions:
- author~=^(pgollucci)$
- label!=contribution/core
- name: Label auto-merge for core
actions:
label:
add:
- auto-merge
conditions:
- label=contribution/core
- label!=auto-merge
- name: refactored queue action rule
conditions: []
actions:
queue:
merge_queue:
max_parallel_checks: 1
40 changes: 40 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.tabSize": 2,
"files.associations": {
"*.yml": "yaml",
"*.yaml": "yaml"
},
"git.enableSmartCommit": true,
"yaml.validate": true,
"yaml.customTags": [
"!Ref",
"!Sub",
"!GetAtt",
"!If",
"!Equals",
"!Not",
"!And",
"!Or",
"!FindInMap",
"!Base64",
"!Cidr",
"!Select",
"!Split",
"!Join"
],
"workbench.colorCustomizations": {
"editorGutter.background": "#000000"
},
"workbench.editorAssociations": {
"*.yaml": "default"
},
"cSpell.words": [
"amannn",
"corepack"
],
"[yaml]": {
"editor.defaultFormatter": "redhat.vscode-yaml"
}
}
Empty file added README.md
Empty file.
44 changes: 44 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "P6 GHA: Setups Node"
description: "P6 GHA: Setups Node"
author: "Philip M. Gollucci"
runs:
using: "composite"
steps:
- name: Install Node.js
shell: bash
run: |
curl -fsSL https://nodejs.org/dist/v22.11.0/node-v22.11.0-linux-x64.tar.xz -o node-v22.11.0-linux-x64.tar.xz
sudo tar -xJf node-v22.11.0-linux-x64.tar.xz -C /usr/local
rm -f node-v22.11.0-linux-x64.tar.xz
echo "/usr/local/node-v22.11.0-linux-x64/bin" >> $GITHUB_PATH
- name: Corepack
shell: bash
run: |
sudo corepack enable
sudo corepack prepare pnpm@latest --activate
- name: Restore NPM node_modules
uses: actions/cache/restore@v4.1.2
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('pnpm-lock.yaml') }}
- name: Check Node
shell: bash
run: |
set +e
which node
which npm
which pnpm
which corepack
node -v
npm -v
pnpm --version
corepack --version
echo $PATH
- name: Install pnpm and dependencies
shell: bash
run: pnpm install
- name: Cache NPM dependencies
uses: actions/cache@v4.1.2
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('pnpm-lock.yaml') }}