mirror of
https://github.com/actions/labeler.git
synced 2025-12-11 20:24:51 +00:00
Compare commits
8 Commits
v3
...
check_dist
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5189af2017 | ||
|
|
feaa12919d | ||
|
|
7ad42be42d | ||
|
|
fc2badc92d | ||
|
|
92ee5c6319 | ||
|
|
f4547bdc4d | ||
|
|
45fbda5933 | ||
|
|
6a1dea0fee |
19
.github/workflows/check_dist.sh
vendored
Executable file
19
.github/workflows/check_dist.sh
vendored
Executable file
@@ -0,0 +1,19 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
dist_index_diff=$(git diff --exit-code --text -- dist/index.js)
|
||||
|
||||
if [[ "$dist_index_diff" ]]; then
|
||||
echo -e "$dist_index_diff\n‼️ Changes detected to dist/index.js! \n\tPlease run \`npm run build' and commit the result." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# - run: |
|
||||
# if [[ "$(git status --porcelain)" != "" ]]; then
|
||||
# echo "::set-output name=createPR::true"
|
||||
# git config --global user.email "github-actions@github.com"
|
||||
# git config --global user.name "github-actions[bot]"
|
||||
# git checkout -b bots/updateGitHubDependencies-${{github.run_number}}
|
||||
# git add .
|
||||
# git commit -m "Update Dependencies"
|
||||
# git push --set-upstream origin bots/updateGitHubDependencies-${{github.run_number}}
|
||||
# fi
|
||||
23
.github/workflows/check_dist.yml
vendored
Normal file
23
.github/workflows/check_dist.yml
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
# Fails if any of dist/index.js needs to be rebuilt
|
||||
|
||||
name: Check dist/index.js
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- check_dist
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- check_dist
|
||||
|
||||
jobs:
|
||||
check_dist:
|
||||
runs-on: ubuntu-latest
|
||||
name: Check dist/index.js for diffs
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- run: npm install
|
||||
- run: npm run build
|
||||
- run: "${GITHUB_WORKSPACE}/.github/workflows/check_dist.sh"
|
||||
32
.github/workflows/check_license_status.yml
vendored
Normal file
32
.github/workflows/check_license_status.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
# Fails if any of our dependencies have licenses that our incompatible with our
|
||||
# requirements (see .licensed.yml) OR if any of our dependencies have been
|
||||
# upgraded to a new version without us having updated their corresponding
|
||||
# license metadata file in .licenses/
|
||||
#
|
||||
# see https://github.com/actions/labeler/pull/91 for more context
|
||||
|
||||
name: Check License Status
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- licensed_cache_update
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
check_license:
|
||||
needs: update_licenses_cache
|
||||
if: always() # always run after we update the license cache. if it failed, we will probably just fail as well
|
||||
runs-on: ubuntu-latest
|
||||
name: Check License Status
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: jonabc/setup-licensed@v1.0.2
|
||||
with:
|
||||
version: '2.x'
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- run: npm install
|
||||
- run: licensed status
|
||||
50
.github/workflows/update_and_check_licenses.yml
vendored
50
.github/workflows/update_and_check_licenses.yml
vendored
@@ -1,50 +0,0 @@
|
||||
name: Licenses
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths: [package.json, package-lock.json]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
paths: [package.json, package-lock.json]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
# Updates our cache of license files in response to changes to our dependencies
|
||||
# declared in package-lock.json. Automatically commits the changes and pushes
|
||||
# them to your branch. NB `check_license_status` should always run *after* this
|
||||
#
|
||||
# see https://github.com/actions/labeler/pull/155 for more context
|
||||
update_licenses:
|
||||
runs-on: ubuntu-latest
|
||||
name: Update Licenses
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: jonabc/setup-licensed@v1
|
||||
with:
|
||||
version: '3.x'
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- run: npm install --production
|
||||
- uses: jonabc/licensed-ci@v1
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# Fails if any of our dependencies have licenses that our incompatible with our
|
||||
# requirements (see .licensed.yml) OR if any of our dependencies have been
|
||||
# upgraded to a new version without us having updated their corresponding
|
||||
# license metadata file in .licenses/
|
||||
#
|
||||
# see https://github.com/actions/labeler/pull/91 for more context
|
||||
check_licenses:
|
||||
needs: update_licenses
|
||||
if: always() # always run after we update the license cache. if it failed, we will probably just fail as well
|
||||
runs-on: ubuntu-latest
|
||||
name: Check Licenses
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: jonabc/setup-licensed@v1.0.2
|
||||
with:
|
||||
version: '3.x'
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- run: npm install
|
||||
- run: licensed status
|
||||
32
.github/workflows/update_license_cache.yml
vendored
Normal file
32
.github/workflows/update_license_cache.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
# Updates our cache of license files in response to changes to our dependencies
|
||||
# declared in package-lock.json. Automatically commits the changes and pushes
|
||||
# them to your branch. NB `check_license_status` should always run *after* this
|
||||
#
|
||||
# see https://github.com/actions/labeler/pull/155 for more context
|
||||
|
||||
name: Update License Cache
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths: [package-lock.json]
|
||||
pull_request:
|
||||
branches: main
|
||||
paths: package-lock.json
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
update_licenses_cache:
|
||||
runs-on: ubuntu-latest
|
||||
name: Update License Cache
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: jonabc/setup-licensed@v1
|
||||
with:
|
||||
version: '2.x'
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- run: npm install --production
|
||||
- uses: jonabc/licensed-ci@v1
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
2
.licenses/npm/@actions/core.dep.yml
generated
2
.licenses/npm/@actions/core.dep.yml
generated
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: "@actions/core"
|
||||
version: 1.6.0
|
||||
version: 1.4.0
|
||||
type: npm
|
||||
summary: Actions core lib
|
||||
homepage: https://github.com/actions/toolkit/tree/main/packages/core
|
||||
|
||||
@@ -63,7 +63,7 @@ label2: example2/*
|
||||
```yml
|
||||
# Add 'repo' label to any root file changes
|
||||
repo:
|
||||
- '*'
|
||||
- ./*
|
||||
|
||||
# Add '@domain/core' label to any change within the 'core' package
|
||||
@domain/core:
|
||||
@@ -88,7 +88,7 @@ frontend:
|
||||
|
||||
Create a workflow (eg: `.github/workflows/labeler.yml` see [Creating a Workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file)) to utilize the labeler action with content:
|
||||
|
||||
```yml
|
||||
```
|
||||
name: "Pull Request Labeler"
|
||||
on:
|
||||
- pull_request_target
|
||||
|
||||
19455
package-lock.json
generated
19455
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
22
package.json
22
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "labeler",
|
||||
"version": "3.1.0",
|
||||
"version": "3.0.2",
|
||||
"description": "Labels pull requests by files altered",
|
||||
"main": "lib/main.js",
|
||||
"scripts": {
|
||||
@@ -22,20 +22,20 @@
|
||||
"author": "GitHub",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.6.0",
|
||||
"@actions/core": "^1.4.0",
|
||||
"@actions/github": "^5.0.0",
|
||||
"js-yaml": "^4.1.0",
|
||||
"minimatch": "^3.0.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^27.4.0",
|
||||
"@types/node": "^16.11.7",
|
||||
"@types/minimatch": "^3.0.5",
|
||||
"@types/js-yaml": "^4.0.5",
|
||||
"@vercel/ncc": "^0.33.3",
|
||||
"jest": "^27.5.1",
|
||||
"prettier": "^2.5.1",
|
||||
"ts-jest": "^27.1.3",
|
||||
"typescript": "^4.5.5"
|
||||
"@types/jest": "^26.0.23",
|
||||
"@types/node": "^15.12.2",
|
||||
"@types/minimatch": "^3.0.4",
|
||||
"@types/js-yaml": "^4.0.1",
|
||||
"@vercel/ncc": "^0.28.6",
|
||||
"jest": "^27.0.4",
|
||||
"prettier": "^2.3.1",
|
||||
"ts-jest": "^27.0.3",
|
||||
"typescript": "^4.3.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ export async function run() {
|
||||
if (syncLabels && labelsToRemove.length) {
|
||||
await removeLabels(client, prNumber, labelsToRemove);
|
||||
}
|
||||
} catch (error: any) {
|
||||
} catch (error) {
|
||||
core.error(error);
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user