Compare commits

..

1 Commits

Author SHA1 Message Date
Josh Rowley
7552f7a5de Add new issues and pull requests to the Projects FR board 2023-09-18 14:26:35 -04:00
8 changed files with 824 additions and 433 deletions

View File

@@ -0,0 +1,21 @@
name: Add new Issues with `bug` label to `Projects Shared FR Triage`
on:
issues:
types:
- opened
pull_request:
types:
- opened
permissions:
contents: read
jobs:
add-to-triage-project:
name: Add issue or pull request to project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@d8e41a41861baa4c7af88a39f7692681e89f6668
with:
project-url: https://github.com/orgs/github/projects/4017
github-token: ${{ secrets.PROJECTS_FR_PROJECT_UPDATE_TOKEN }}

View File

@@ -15,11 +15,6 @@ on:
paths-ignore:
- '**.md'
env:
# A pipe-separated array of files to ignore when comparing the expected and actual dist/ directories,
# which are used as a regular expression filter in the `grep` command.
FILES_TO_IGNORE: 'index.js.map|sourcemap-register.js'
jobs:
check-dist:
runs-on: ubuntu-latest
@@ -27,10 +22,10 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set Node.js 20.x
- name: Set Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 20.x
node-version: 16.x
cache: npm
- name: Install dependencies
@@ -43,23 +38,15 @@ jobs:
- name: Compare the expected and actual dist/ directories
run: |
# Get a list of files that are different between the checked-in dist/ directory and the generated dist/ directory,
# then trim the list to remove any leading or trailing whitespace.
CHANGED_FILES=$(git diff --ignore-space-at-eol --name-only dist/ | grep -vE "$FILES_TO_IGNORE" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
if [ -n "$CHANGED_FILES" ]; then
echo "❗️ Detected uncommitted changes after build (see diff output below)." >&2
echo "This indicates that the dist/ directory is out of sync with the checked-in index.js.\n" >&2
echo "⭐️ If the changes below are expected, run 'npm run build:compile && npm run build:package' and commit the output files." >&2
# Run `git diff` for each line/file in $CHANGED_FILES:
echo "$CHANGED_FILES" | xargs -I {} git diff --ignore-space-at-eol --text -- {}
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
else
echo "✅ No uncommitted changes detected after build."
fi
id: diff
# If index.js was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v3
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist

View File

@@ -42,7 +42,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -53,7 +53,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3
uses: github/codeql-action/autobuild@v2
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
@@ -67,4 +67,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@v2

View File

@@ -81,7 +81,7 @@ on:
jobs:
add-to-project:
name: Add pull request to project
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@RELEASE_VERSION

View File

@@ -3,7 +3,6 @@ description: Automatically add issues and PRs to GitHub projects
author: GitHub
branding:
icon: table
color: white
inputs:
project-url:
required: true
@@ -21,5 +20,5 @@ outputs:
itemId:
description: The ID of the item that was added to the project
runs:
using: 'node20'
using: 'node16'
main: 'dist/index.js'

1179
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -8,21 +8,21 @@
"@actions/github": "^5.1.1"
},
"engines": {
"node": ">=16.0.0",
"node": ">=16.0.0 <20.0.0",
"npm": ">= 8.0.0"
},
"devDependencies": {
"@github/prettier-config": "^0.0.6",
"@types/jest": "^29.5.7",
"@types/node": "16.18.60",
"@typescript-eslint/parser": "^6.9.1",
"@types/jest": "^29.5.4",
"@types/node": "16.18.51",
"@typescript-eslint/parser": "^6.7.0",
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@vercel/ncc": "^0.38.0",
"concurrently": "^8.2.2",
"eslint": "^8.57.0",
"concurrently": "^8.2.1",
"eslint": "^8.49.0",
"eslint-plugin-github": "^4.10.0",
"eslint-plugin-jest": "^27.6.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-jest": "^27.2.3",
"eslint-plugin-prettier": "^5.0.0",
"jest": "^29.7.0",
"prettier": "3.0.3",
"ts-jest": "^29.1.1",

View File

@@ -117,11 +117,6 @@ export async function addToProject(): Promise<void> {
if (issueOwnerName === projectOwnerName) {
core.info('Creating project item')
if (issueOwnerName === 'github') {
console.log('this is a test')
throw new Error('test')
}
const addResp = await octokit.graphql<ProjectAddItemResponse>(
`mutation addIssueToProject($input: AddProjectV2ItemByIdInput!) {
addProjectV2ItemById(input: $input) {