Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e4bde6ce7c | |||
| 20883c95e8 | |||
| 4d00b7d5b6 |
@@ -1,77 +0,0 @@
|
|||||||
name: Update issue Status
|
|
||||||
|
|
||||||
on:
|
|
||||||
issues:
|
|
||||||
types: [closed]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
update_issue:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Get project data
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{secrets.GHPROJECT_TOKEN}}
|
|
||||||
ORGANIZATION: specklesystems
|
|
||||||
PROJECT_NUMBER: 9
|
|
||||||
run: |
|
|
||||||
gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query='
|
|
||||||
query($org: String!, $number: Int!) {
|
|
||||||
organization(login: $org){
|
|
||||||
projectNext(number: $number) {
|
|
||||||
id
|
|
||||||
fields(first:20) {
|
|
||||||
nodes {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
settings
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json
|
|
||||||
|
|
||||||
echo 'PROJECT_ID='$(jq '.data.organization.projectNext.id' project_data.json) >> $GITHUB_ENV
|
|
||||||
echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV
|
|
||||||
|
|
||||||
echo "$PROJECT_ID"
|
|
||||||
echo "$STATUS_FIELD_ID"
|
|
||||||
|
|
||||||
echo 'DONE_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") | .settings | fromjson | .options[] | select(.name== "Done") | .id' project_data.json) >> $GITHUB_ENV
|
|
||||||
echo "$DONE_ID"
|
|
||||||
|
|
||||||
- name: Add Issue to project #it's already in the project, but we do this to get its node id!
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{secrets.GHPROJECT_TOKEN}}
|
|
||||||
ISSUE_ID: ${{ github.event.issue.node_id }}
|
|
||||||
run: |
|
|
||||||
item_id="$( gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query='
|
|
||||||
mutation($project:ID!, $id:ID!) {
|
|
||||||
addProjectNextItem(input: {projectId: $project, contentId: $id}) {
|
|
||||||
projectNextItem {
|
|
||||||
id
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}' -f project=$PROJECT_ID -f id=$ISSUE_ID --jq '.data.addProjectNextItem.projectNextItem.id')"
|
|
||||||
|
|
||||||
echo 'ITEM_ID='$item_id >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Update Status
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{secrets.GHPROJECT_TOKEN}}
|
|
||||||
ISSUE_ID: ${{ github.event.issue.node_id }}
|
|
||||||
run: |
|
|
||||||
gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query='
|
|
||||||
mutation($project:ID!, $status:ID!, $id:ID!, $value:String!) {
|
|
||||||
set_status: updateProjectNextItemField(
|
|
||||||
input: {
|
|
||||||
projectId: $project
|
|
||||||
itemId: $id
|
|
||||||
fieldId: $status
|
|
||||||
value: $value
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
projectNextItem {
|
|
||||||
id
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}' -f project=$PROJECT_ID -f status=$STATUS_FIELD_ID -f id=$ITEM_ID -f value=${{ env.DONE_ID }}
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
name: Move new issues into Project
|
|
||||||
|
|
||||||
on:
|
|
||||||
issues:
|
|
||||||
types: [opened]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
track_issue:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Get project data
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{secrets.GHPROJECT_TOKEN}}
|
|
||||||
ORGANIZATION: specklesystems
|
|
||||||
PROJECT_NUMBER: 9
|
|
||||||
run: |
|
|
||||||
gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query='
|
|
||||||
query($org: String!, $number: Int!) {
|
|
||||||
organization(login: $org){
|
|
||||||
projectNext(number: $number) {
|
|
||||||
id
|
|
||||||
fields(first:20) {
|
|
||||||
nodes {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
settings
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json
|
|
||||||
|
|
||||||
echo 'PROJECT_ID='$(jq '.data.organization.projectNext.id' project_data.json) >> $GITHUB_ENV
|
|
||||||
echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Add Issue to project
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{secrets.GHPROJECT_TOKEN}}
|
|
||||||
ISSUE_ID: ${{ github.event.issue.node_id }}
|
|
||||||
run: |
|
|
||||||
item_id="$( gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query='
|
|
||||||
mutation($project:ID!, $id:ID!) {
|
|
||||||
addProjectNextItem(input: {projectId: $project, contentId: $id}) {
|
|
||||||
projectNextItem {
|
|
||||||
id
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}' -f project=$PROJECT_ID -f id=$ISSUE_ID --jq '.data.addProjectNextItem.projectNextItem.id')"
|
|
||||||
|
|
||||||
echo 'ITEM_ID='$item_id >> $GITHUB_ENV
|
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
name: Release pipeline
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '**' # all branches
|
||||||
|
tags:
|
||||||
|
- "[0-9]+.[0-9]+.[0-9]+"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
|
||||||
|
permissions: {} # purposefully empty by default at workflow level, explicitly overridden for specific jobs below
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pre-commit:
|
||||||
|
name: Precommit check
|
||||||
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: read # to be able to pull the pre-commit-runner image from ghcr.io
|
||||||
|
container:
|
||||||
|
image: ghcr.io/specklesystems/pre-commit-runner:latest # zizmor: ignore[unpinned-images] Speckle own this image repository
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
persist-credentials: false
|
||||||
|
- run: git config --global --add safe.directory $PWD
|
||||||
|
- name: Set precommit
|
||||||
|
run: pre-commit install-hooks --config ./.pre-commit-config.yaml
|
||||||
|
- name: Run precommit
|
||||||
|
run: pre-commit run --all-files --config ./.pre-commit-config.yaml
|
||||||
|
- name: Diff on failure
|
||||||
|
if: failure()
|
||||||
|
run: git --no-pager diff
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
default_stages:
|
||||||
|
- 'pre-commit'
|
||||||
|
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: 'v6.0.0'
|
||||||
|
hooks:
|
||||||
|
- id: check-yaml
|
||||||
|
- id: check-merge-conflict
|
||||||
|
- id: check-executables-have-shebangs
|
||||||
|
- id: check-shebang-scripts-are-executable
|
||||||
|
- id: check-symlinks
|
||||||
|
- id: check-vcs-permalinks
|
||||||
|
- id: trailing-whitespace
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
|
||||||
|
- repo: https://github.com/syntaqx/git-hooks
|
||||||
|
rev: 'v0.0.18'
|
||||||
|
hooks:
|
||||||
|
- id: forbid-binary
|
||||||
|
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit
|
||||||
|
rev: 'v4.5.1'
|
||||||
|
hooks:
|
||||||
|
- id: validate_manifest
|
||||||
|
|
||||||
|
ci:
|
||||||
|
autoupdate_schedule: quarterly
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
- id: ggshield-not-ci
|
- id: ggshield-not-ci
|
||||||
name: GitGuardian Shield (pre-commit)
|
name: GitGuardian Shield (pre-commit)
|
||||||
description: Runs ggshield in non-CI environments to detect hardcoded secrets, security vulnerabilities and policy breaks.
|
description: Runs ggshield in non-CI environments to detect hardcoded secrets, security vulnerabilities and policy breaks.
|
||||||
stages: [commit]
|
stages: [pre-commit]
|
||||||
entry: hooks/ggshield-not-ci.sh
|
entry: hooks/ggshield-not-ci.sh
|
||||||
language: script
|
language: script
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
.github/
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"trailingComma": "none",
|
||||||
|
"tabWidth": 2,
|
||||||
|
"semi": false,
|
||||||
|
"endOfLine": "auto",
|
||||||
|
"bracketSpacing": true,
|
||||||
|
"vueIndentScriptAndStyle": false,
|
||||||
|
"htmlWhitespaceSensitivity": "ignore",
|
||||||
|
"printWidth": 88,
|
||||||
|
"singleQuote": true
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# Speckle Repo Management Templates
|
# Speckle Pre-Commit Hooks
|
||||||
|
|
||||||
[](https://twitter.com/SpeckleSystems) [](https://discourse.speckle.works) [](https://speckle.systems) [](https://speckle.guide/dev/)
|
[](https://twitter.com/SpeckleSystems) [](https://discourse.speckle.works) [](https://speckle.systems) [](https://speckle.guide/dev/)
|
||||||
|
|
||||||
@@ -17,6 +17,7 @@ Comprehensive developer and user documentation for Speckle can be found in our:
|
|||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
1. Add the following to your `.pre-commit-config.yaml` file:
|
1. Add the following to your `.pre-commit-config.yaml` file:
|
||||||
|
|
||||||
```
|
```
|
||||||
- repo: https://github.com/specklesystems/pre-commit
|
- repo: https://github.com/specklesystems/pre-commit
|
||||||
rev: '0.1.0'
|
rev: '0.1.0'
|
||||||
@@ -27,11 +28,14 @@ Comprehensive developer and user documentation for Speckle can be found in our:
|
|||||||
## Developing & Debugging
|
## Developing & Debugging
|
||||||
|
|
||||||
1. install:
|
1. install:
|
||||||
- `git`
|
|
||||||
- `pre-commit`
|
- `git`
|
||||||
|
- `pre-commit`
|
||||||
|
|
||||||
1. Git clone this repository. Detailed steps on how to do that can be found on [GitHub's documentation](https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls).
|
1. Git clone this repository. Detailed steps on how to do that can be found on [GitHub's documentation](https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls).
|
||||||
1. In a terminal, `cd` into a directory containing code that you wish to try the pre-commit hook on. e.g. Speckle's `speckle-server` repository.
|
1. In a terminal, `cd` into a directory containing code that you wish to try the pre-commit hook on. e.g. Speckle's `speckle-server` repository.
|
||||||
1. Run the following command to run a pre-commit hook directly from this repository. Replace `<pre-commit hook to run>` with the name of the hook you wish to run:
|
1. Run the following command to run a pre-commit hook directly from this repository. Replace `<pre-commit hook to run>` with the name of the hook you wish to run:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
pre-commit try-repo ./path/to/cloned/specklesystems/pre-commit <pre-commit hook to run>
|
pre-commit try-repo ./path/to/cloned/specklesystems/pre-commit <pre-commit hook to run>
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
|
|
||||||
if [[ ! -z "${CI}"} ]]; then
|
if [[ -z "${CI}" ]]; then
|
||||||
ggshield secret scan pre-commit
|
ggshield secret scan pre-commit
|
||||||
|
else
|
||||||
|
echo "Detected that this script is running in a CI environment, so skipping GitGuardian ggshield"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user