Compare commits

..

1 Commits

Author SHA1 Message Date
Matthew Costabile
6ee18b2470 Update README.md 2023-07-25 08:13:14 -04:00
9 changed files with 1694 additions and 1420 deletions

View File

@@ -15,22 +15,17 @@ 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
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- 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

@@ -38,11 +38,11 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v3
# 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

@@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
name: Check licenses
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- run: npm ci
- name: Install licensed
run: |

View File

@@ -13,7 +13,7 @@ jobs:
build: # make sure build/ci work properly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- run: |
npm install
- run: |

View File

@@ -7,7 +7,7 @@ Note that this action does not support [GitHub projects (classic)](https://docs.
[![build-test](https://github.com/actions/add-to-project/actions/workflows/test.yml/badge.svg)](https://github.com/actions/add-to-project/actions/workflows/test.yml)
> **NOTE:** ⚠️ This action no longer uses the deprecated ProjectNext API. If you are looking for the old version of that action, use version [v0.0.5](https://github.com/actions/add-to-project/releases/tag/v0.0.5).
> **NOTE:** ⚠️ This action no longer uses the deprecated ProjectNext API. If you are looking for the old version of that action, use version [v0.0.3](https://github.com/actions/add-to-project/releases/tag/v0.0.3).
## Usage
@@ -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'

3035
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -8,25 +8,25 @@
"@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",
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@vercel/ncc": "^0.38.0",
"concurrently": "^8.2.2",
"eslint": "^8.57.0",
"eslint-plugin-github": "^4.10.0",
"eslint-plugin-jest": "^27.6.0",
"eslint-plugin-prettier": "^5.1.3",
"jest": "^29.7.0",
"prettier": "3.0.3",
"@types/jest": "^29.5.3",
"@types/node": "16.18.39",
"@typescript-eslint/parser": "^6.1.0",
"@typescript-eslint/eslint-plugin": "^6.1.0",
"@vercel/ncc": "^0.36.1",
"concurrently": "^8.2.0",
"eslint": "^8.45.0",
"eslint-plugin-github": "^4.9.2",
"eslint-plugin-jest": "^27.2.3",
"eslint-plugin-prettier": "^5.0.0",
"jest": "^29.6.1",
"prettier": "3.0.0",
"ts-jest": "^29.1.1",
"typescript": "^5.2.2"
"typescript": "^5.1.6"
},
"keywords": [
"actions",

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) {