Compare commits

..

8 Commits

Author SHA1 Message Date
Patrick Ellis
5189af2017 f 2021-06-21 12:24:01 -04:00
Patrick Ellis
feaa12919d Merge branch 'main' into check_dist 2021-06-21 12:19:33 -04:00
Patrick Ellis
7ad42be42d f 2021-06-18 13:51:07 -04:00
Patrick Ellis
fc2badc92d f 2021-06-18 13:47:02 -04:00
Patrick Ellis
92ee5c6319 f 2021-06-18 13:44:21 -04:00
Patrick Ellis
f4547bdc4d f 2021-06-18 13:21:33 -04:00
Patrick Ellis
45fbda5933 f 2021-06-18 13:12:12 -04:00
Patrick Ellis
6a1dea0fee WIP check for diffs in dist/index.js and complain 2021-06-18 13:11:53 -04:00
10 changed files with 16154 additions and 3487 deletions

19
.github/workflows/check_dist.sh vendored Executable file
View 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
View 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"

View 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

View File

@@ -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

View 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 }}

View File

@@ -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

View File

@@ -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

File diff suppressed because it is too large Load Diff

View File

@@ -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"
}
}

View File

@@ -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);
}