mirror of
https://github.com/actions/add-to-project.git
synced 2025-12-13 05:27:56 +00:00
Compare commits
35 Commits
joshrowley
...
camchenry/
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c433aa66a | ||
|
|
34dcf61506 | ||
|
|
032c0af29a | ||
|
|
3c0dc2fb24 | ||
|
|
831555bfab | ||
|
|
23a466f0a1 | ||
|
|
a529082df9 | ||
|
|
3d28050eae | ||
|
|
df5516beff | ||
|
|
92dbc06e5d | ||
|
|
04b135066e | ||
|
|
d300992994 | ||
|
|
fdcca9b630 | ||
|
|
d18e1683af | ||
|
|
e589e53cb5 | ||
|
|
0609a2702e | ||
|
|
9431bea31b | ||
|
|
0008229a22 | ||
|
|
4c39393a8d | ||
|
|
5a5c08a0d8 | ||
|
|
0be3b6580a | ||
|
|
9c5d7e2309 | ||
|
|
6460bf625c | ||
|
|
c48fdd4a10 | ||
|
|
b953640a26 | ||
|
|
f9db65bca7 | ||
|
|
14158fbdd3 | ||
|
|
2271bbc40a | ||
|
|
4ae637c179 | ||
|
|
aff20dd010 | ||
|
|
a6f5f3bc15 | ||
|
|
af8bceb810 | ||
|
|
110be9cca7 | ||
|
|
1af3c586cc | ||
|
|
038cf47bad |
@@ -1,21 +0,0 @@
|
|||||||
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 }}
|
|
||||||
25
.github/workflows/check-dist.yml
vendored
25
.github/workflows/check-dist.yml
vendored
@@ -15,6 +15,11 @@ on:
|
|||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '**.md'
|
- '**.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:
|
jobs:
|
||||||
check-dist:
|
check-dist:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -22,10 +27,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set Node.js 16.x
|
- name: Set Node.js 20.x
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: 20.x
|
||||||
cache: npm
|
cache: npm
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
@@ -38,15 +43,23 @@ jobs:
|
|||||||
|
|
||||||
- name: Compare the expected and actual dist/ directories
|
- name: Compare the expected and actual dist/ directories
|
||||||
run: |
|
run: |
|
||||||
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
|
# Get a list of files that are different between the checked-in dist/ directory and the generated dist/ directory,
|
||||||
echo "Detected uncommitted changes after build. See status below:"
|
# then trim the list to remove any leading or trailing whitespace.
|
||||||
git diff
|
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 -- {}
|
||||||
exit 1
|
exit 1
|
||||||
|
else
|
||||||
|
echo "✅ No uncommitted changes detected after build."
|
||||||
fi
|
fi
|
||||||
id: diff
|
id: diff
|
||||||
|
|
||||||
# If index.js was different than expected, upload the expected version as an artifact
|
# If index.js was different than expected, upload the expected version as an artifact
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v4
|
||||||
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
|
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
|
||||||
with:
|
with:
|
||||||
name: dist
|
name: dist
|
||||||
|
|||||||
6
.github/workflows/codeql-analysis.yml
vendored
6
.github/workflows/codeql-analysis.yml
vendored
@@ -42,7 +42,7 @@ jobs:
|
|||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
# Initializes the CodeQL tools for scanning.
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v2
|
uses: github/codeql-action/init@v3
|
||||||
with:
|
with:
|
||||||
languages: ${{ matrix.language }}
|
languages: ${{ matrix.language }}
|
||||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
# 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).
|
# 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)
|
# If this step fails, then you should remove it and run the build manually (see below)
|
||||||
- name: Autobuild
|
- name: Autobuild
|
||||||
uses: github/codeql-action/autobuild@v2
|
uses: github/codeql-action/autobuild@v3
|
||||||
|
|
||||||
# ℹ️ Command-line programs to run using the OS shell.
|
# ℹ️ Command-line programs to run using the OS shell.
|
||||||
# 📚 https://git.io/JvXDl
|
# 📚 https://git.io/JvXDl
|
||||||
@@ -67,4 +67,4 @@ jobs:
|
|||||||
# make release
|
# make release
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@v2
|
uses: github/codeql-action/analyze@v3
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
add-to-project:
|
add-to-project:
|
||||||
name: Add issue to project
|
name: Add pull request to project
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/add-to-project@RELEASE_VERSION
|
- uses: actions/add-to-project@RELEASE_VERSION
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ description: Automatically add issues and PRs to GitHub projects
|
|||||||
author: GitHub
|
author: GitHub
|
||||||
branding:
|
branding:
|
||||||
icon: table
|
icon: table
|
||||||
|
color: white
|
||||||
inputs:
|
inputs:
|
||||||
project-url:
|
project-url:
|
||||||
required: true
|
required: true
|
||||||
@@ -20,5 +21,5 @@ outputs:
|
|||||||
itemId:
|
itemId:
|
||||||
description: The ID of the item that was added to the project
|
description: The ID of the item that was added to the project
|
||||||
runs:
|
runs:
|
||||||
using: 'node16'
|
using: 'node20'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
|
|||||||
1177
package-lock.json
generated
1177
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
16
package.json
16
package.json
@@ -8,21 +8,21 @@
|
|||||||
"@actions/github": "^5.1.1"
|
"@actions/github": "^5.1.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.0.0 <20.0.0",
|
"node": ">=16.0.0",
|
||||||
"npm": ">= 8.0.0"
|
"npm": ">= 8.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@github/prettier-config": "^0.0.6",
|
"@github/prettier-config": "^0.0.6",
|
||||||
"@types/jest": "^29.5.4",
|
"@types/jest": "^29.5.7",
|
||||||
"@types/node": "16.18.51",
|
"@types/node": "16.18.60",
|
||||||
"@typescript-eslint/parser": "^6.7.0",
|
"@typescript-eslint/parser": "^6.9.1",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.7.0",
|
"@typescript-eslint/eslint-plugin": "^6.7.0",
|
||||||
"@vercel/ncc": "^0.38.0",
|
"@vercel/ncc": "^0.38.0",
|
||||||
"concurrently": "^8.2.1",
|
"concurrently": "^8.2.2",
|
||||||
"eslint": "^8.49.0",
|
"eslint": "^8.57.0",
|
||||||
"eslint-plugin-github": "^4.10.0",
|
"eslint-plugin-github": "^4.10.0",
|
||||||
"eslint-plugin-jest": "^27.2.3",
|
"eslint-plugin-jest": "^27.6.0",
|
||||||
"eslint-plugin-prettier": "^5.0.0",
|
"eslint-plugin-prettier": "^5.1.3",
|
||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
"prettier": "3.0.3",
|
"prettier": "3.0.3",
|
||||||
"ts-jest": "^29.1.1",
|
"ts-jest": "^29.1.1",
|
||||||
|
|||||||
@@ -117,6 +117,11 @@ export async function addToProject(): Promise<void> {
|
|||||||
if (issueOwnerName === projectOwnerName) {
|
if (issueOwnerName === projectOwnerName) {
|
||||||
core.info('Creating project item')
|
core.info('Creating project item')
|
||||||
|
|
||||||
|
if (issueOwnerName === 'github') {
|
||||||
|
console.log('this is a test')
|
||||||
|
throw new Error('test')
|
||||||
|
}
|
||||||
|
|
||||||
const addResp = await octokit.graphql<ProjectAddItemResponse>(
|
const addResp = await octokit.graphql<ProjectAddItemResponse>(
|
||||||
`mutation addIssueToProject($input: AddProjectV2ItemByIdInput!) {
|
`mutation addIssueToProject($input: AddProjectV2ItemByIdInput!) {
|
||||||
addProjectV2ItemById(input: $input) {
|
addProjectV2ItemById(input: $input) {
|
||||||
|
|||||||
Reference in New Issue
Block a user