Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge primary branch to demo-branch #58

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0995b28
Add stale config to automatically mark issues as stale due to inactiv…
FranzDiebold Nov 13, 2021
20f2d33
Merge pull request #44 from FranzDiebold/feat/add-stale-config
FranzDiebold Nov 13, 2021
e47963f
Add devcontainer.
FranzDiebold Jan 17, 2022
4f9edd3
Update dependencies.
FranzDiebold Jan 17, 2022
14adaf3
Update version.
FranzDiebold Jan 17, 2022
3afae2c
Update dependencies.
FranzDiebold Jan 18, 2022
3f6bf39
Merge pull request #45 from FranzDiebold/feat/v2-3-1
FranzDiebold Jan 18, 2022
c6a8cb2
Add GitHub sponsors funding.
FranzDiebold Apr 13, 2022
3ca94d3
Merge pull request #46 from FranzDiebold/chore/add-funding
FranzDiebold Apr 13, 2022
ad0bd50
Expose pull request id as CI_PR_NUMBER and CI_PR_ID
iamstarkov Jul 5, 2022
16fae30
add printing CI_PR_NUMBER and CI_PR_ID into the demo workflow
iamstarkov Jul 6, 2022
b21b36d
Update version and dependencies.
FranzDiebold Jul 7, 2022
010b249
Update demo.
FranzDiebold Jul 7, 2022
dae1d34
Merge pull request #47 from iamstarkov/feat/CI_PR_NUMBER
FranzDiebold Jul 7, 2022
e59d29a
Expose an actual SHA for pull requests as CI_PR_SHA(_SHORT).
iamstarkov Jul 12, 2022
2858253
Improve Makefile: Add help texts.
FranzDiebold Jul 16, 2022
d144085
Prepare for release.
FranzDiebold Jul 16, 2022
72510ef
Merge pull request #48 from iamstarkov/feat/CI_BASE_SHA
FranzDiebold Jul 16, 2022
0f5d8f2
Fix CI_PR_SHA.
FranzDiebold Jul 17, 2022
7759a76
Update Readme: Add newly added environment variables.
FranzDiebold Jul 17, 2022
61e09f0
Merge pull request #51 from FranzDiebold/feat/CI_PR_SHA
FranzDiebold Jul 17, 2022
960f2f1
Update dependencies.
FranzDiebold Sep 10, 2022
9d7426b
Truncate slug values to 63 characters.
FranzDiebold Sep 11, 2022
9e73536
Merge pull request #53 from FranzDiebold/52-_slug-envs-are-not-truncated
FranzDiebold Sep 11, 2022
1d4d145
Update CI/CD pipeline: Update dependencies.
FranzDiebold Sep 23, 2022
ae57c7f
Update NodeJS version.
FranzDiebold Sep 23, 2022
716ba0a
Update lib version.
FranzDiebold Sep 23, 2022
2d0ded6
Update dist package.
FranzDiebold Sep 23, 2022
5be1a82
Merge pull request #54 from FranzDiebold/feat/update-node-version
FranzDiebold Sep 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/javascript-node/.devcontainer/base.Dockerfile

# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 16, 14, 12, 16-bullseye, 14-bullseye, 12-bullseye, 16-buster, 14-buster, 12-buster
ARG VARIANT="16-bullseye"
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

# [Optional] Uncomment if you want to install an additional version of node using nvm
# ARG EXTRA_NODE_VERSION=10
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"

# [Optional] Uncomment if you want to install more global node modules
# RUN su node -c "npm install -g <your-package-list-here>"
26 changes: 26 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/javascript-node
{
"name": "Node.js",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick a Node version: 16, 14, 12.
// Append -bullseye or -buster to pin to an OS version.
// Use -bullseye variants on local arm64/Apple Silicon.
"args": {
"VARIANT": "16"
}
},
// Set *default* container specific settings.json values on container create.
"settings": {},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"dbaeumer.vscode-eslint"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "yarn install",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "node"
}
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: FranzDiebold
17 changes: 17 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 30
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ jobs:
lint_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: '12'
node-version: 16
- name: Install dependencies
run: make install
- name: Lint
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
echo "CI_BASE_REF=$CI_BASE_REF"
echo "CI_SHA_SHORT=$CI_SHA_SHORT"
echo "CI_SHA=$CI_SHA"
echo "CI_PR_SHA_SHORT=$CI_PR_SHA_SHORT"
echo "CI_PR_SHA=$CI_PR_SHA"
echo "CI_PR_NUMBER=$CI_PR_NUMBER"
echo "CI_PR_ID=$CI_PR_ID"
echo "CI_PR_TITLE=$CI_PR_TITLE"
echo "CI_PR_DESCRIPTION=$CI_PR_DESCRIPTION"
echo "CI_ACTOR=$CI_ACTOR"
Expand Down Expand Up @@ -75,6 +79,10 @@ jobs:
echo "CI_BASE_REF=$Env:CI_BASE_REF"
echo "CI_SHA_SHORT=$Env:CI_SHA_SHORT"
echo "CI_SHA=$Env:CI_SHA"
echo "CI_PR_SHA_SHORT=$Env:CI_PR_SHA_SHORT"
echo "CI_PR_SHA=$Env:CI_PR_SHA"
echo "CI_PR_NUMBER=$Env:CI_PR_NUMBER"
echo "CI_PR_ID=$Env:CI_PR_ID"
echo "CI_PR_TITLE=$Env:CI_PR_TITLE"
echo "CI_PR_DESCRIPTION=$Env:CI_PR_DESCRIPTION"
echo "CI_ACTOR=$Env:CI_ACTOR"
Expand Down Expand Up @@ -122,6 +130,10 @@ jobs:
echo "CI_BASE_REF=$CI_BASE_REF"
echo "CI_SHA_SHORT=$CI_SHA_SHORT"
echo "CI_SHA=$CI_SHA"
echo "CI_PR_SHA_SHORT=$CI_PR_SHA_SHORT"
echo "CI_PR_SHA=$CI_PR_SHA"
echo "CI_PR_NUMBER=$CI_PR_NUMBER"
echo "CI_PR_ID=$CI_PR_ID"
echo "CI_PR_TITLE=$CI_PR_TITLE"
echo "CI_PR_DESCRIPTION=$CI_PR_DESCRIPTION"
echo "CI_ACTOR=$CI_ACTOR"
Expand Down
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
.PHONY: help
help: ## Show this help.
@egrep '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-22s\033[0m %s\n", $$1, $$2}'

.PHONY: install
install:
install: ## Install dependencies.
npm install

.PHONY: lint
lint:
lint: ## Lint code.
npm run lint

.PHONY: test
test:
test: ## Run tests.
npm run test

.PHONY: build
build:
build: ## Build code for distribution.
npm run build
28 changes: 19 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![GitHub Action: View on Marketplace](https://img.shields.io/badge/GitHub%20Action-View_on_Marketplace-28a745?logo=github)](https://github.com/marketplace/actions/github-environment-variables-action)
[![Demo: available](https://img.shields.io/badge/Demo-available-orange)](.github/workflows/demo.yml)
[![Version: v2.3.0](https://img.shields.io/badge/Version-v2.3.0-brightgreen)](https://github.com/FranzDiebold/github-env-vars-action/releases/tag/v2.3.0)
[![Version: v2.7.0](https://img.shields.io/badge/Version-v2.7.0-brightgreen)](https://github.com/FranzDiebold/github-env-vars-action/releases/tag/v2.7.0)
[![Lint and Test](https://github.com/FranzDiebold/github-env-vars-action/workflows/Lint%20and%20Test/badge.svg)](https://github.com/FranzDiebold/github-env-vars-action/actions?query=workflow%3A%22Lint+and+Test%22)
[![license: MIT](https://img.shields.io/badge/license-MIT-brightgreen.svg)](./LICENSE)

Expand All @@ -12,24 +12,28 @@ A [GitHub Action](https://github.com/features/actions) to expose useful environm

| Environment Variable Name | Description | Example value |
|--------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------|
| `CI_REPOSITORY_SLUG` | The slug of the owner and repository name (i.e. slug of `FranzDiebold/github-env-vars-action`). | `franzdiebold-github-env-vars-action` |
| `CI_REPOSITORY_SLUG` | The slug of the owner and repository name (i.e. slug of `FranzDiebold/github-env-vars-action`). The slug is truncated to 63 characters. | `franzdiebold-github-env-vars-action` |
| `CI_REPOSITORY_OWNER` | The owner of the repository. | `FranzDiebold` |
| `CI_REPOSITORY_OWNER_SLUG` | The slug of the owner of the repository. | `franzdiebold` |
| `CI_REPOSITORY_OWNER_SLUG` | The slug of the owner of the repository. The slug is truncated to 63 characters. | `franzdiebold` |
| `CI_REPOSITORY_NAME` | The name of the repository. | `github-env-vars-action` |
| `CI_REPOSITORY_NAME_SLUG` | The slug of the name of the repository. | `github-env-vars-action` |
| `CI_REPOSITORY_NAME_SLUG` | The slug of the name of the repository. The slug is truncated to 63 characters. | `github-env-vars-action` |
| `CI_REPOSITORY` | The owner and repository name. Copy of `GITHUB_REPOSITORY` - for reasons of completeness. | `FranzDiebold/github-env-vars-action` |
| `CI_REF_SLUG` | The slug of the branch, tag or PR number *ref* that triggered the workflow (i.e. slug of `refs/heads/feat/feature-branch-1`). <br>If neither a branch, tag or PR number is available for the event type, the variable will not exist. | `refs-heads-feat-feature-branch-1` or<br> `refs-tags-v1-3-7` or<br> `refs-pull-42-merge` |
| `CI_REF_SLUG` | The slug of the branch, tag or PR number *ref* that triggered the workflow (i.e. slug of `refs/heads/feat/feature-branch-1`). <br>If neither a branch, tag or PR number is available for the event type, the variable will not exist. The slug is truncated to 63 characters. | `refs-heads-feat-feature-branch-1` or<br> `refs-tags-v1-3-7` or<br> `refs-pull-42-merge` |
| `CI_ACTION_REF_NAME` | The branch or tag *name* that triggered the workflow. For pull requests it is the *head* branch name. | `feat/feature-branch-1` or<br> `v1.3.7` |
| `CI_ACTION_REF_NAME_SLUG` | The slug of the branch or tag *name* that triggered the workflow. For pull requests it is the slug of the *head* branch name. | `feat-feature-branch-1` or<br> `v1-3-7` |
| `CI_ACTION_REF_NAME_SLUG` | The slug of the branch or tag *name* that triggered the workflow. For pull requests it is the slug of the *head* branch name. The slug is truncated to 63 characters. | `feat-feature-branch-1` or<br> `v1-3-7` |
| `CI_REF_NAME` | The branch *name*, tag *name* or PR number that triggered the workflow. <br>If neither a branch, tag or PR number is available for the event type, the variable will not exist. | `feat/feature-branch-1` or<br> `v1.3.7` or<br> `42/merge` |
| `CI_REF_NAME_SLUG` | The slug of the branch *name*, tag *name* or PR number that triggered the workflow. <br>If neither a branch, tag or PR number is available for the event type, the variable will not exist. | `feat-feature-branch-1` or<br> `v1-3-7` or<br> `42-merge` |
| `CI_REF_NAME_SLUG` | The slug of the branch *name*, tag *name* or PR number that triggered the workflow. <br>If neither a branch, tag or PR number is available for the event type, the variable will not exist. The slug is truncated to 63 characters. | `feat-feature-branch-1` or<br> `v1-3-7` or<br> `42-merge` |
| `CI_REF` | The branch, tag or PR number *ref* that triggered the workflow. <br>If neither a branch, tag or PR number is available for the event type, the variable will not exist. Copy of `GITHUB_REF` - for reasons of completeness. | `refs/heads/feat/feature-branch-1` or<br> `refs/tags/v1.3.7` or<br> `refs/pull/42/merge` |
| `CI_HEAD_REF_SLUG` | The slug of the head branch *name*. <br>Only set for event type *pull request* or forked repositories. | `feat-feature-branch-1` |
| `CI_HEAD_REF_SLUG` | The slug of the head branch *name*. <br>Only set for event type *pull request* or forked repositories. The slug is truncated to 63 characters. | `feat-feature-branch-1` |
| `CI_HEAD_REF` | Only set for forked repositories / pull request. The branch of the head repository / the head branch name. Copy of `GITHUB_HEAD_REF` - for reasons of completeness. | `feat/feature-branch-1` |
| `CI_BASE_REF_SLUG` | The slug of the base branch *name*. <br>Only set for event type *pull request* or forked repositories. | `main` |
| `CI_BASE_REF_SLUG` | The slug of the base branch *name*. <br>Only set for event type *pull request* or forked repositories. The slug is truncated to 63 characters. | `main` |
| `CI_BASE_REF` | Only set for forked repositories / pull request. The branch of the base repository / the base branch name. Copy of `GITHUB_BASE_REF` - for reasons of completeness. | `main` |
| `CI_SHA_SHORT` | The shortened commit SHA (8 characters) that triggered the workflow. | `ffac537e` |
| `CI_SHA` | The commit SHA that triggered the workflow. Copy of `GITHUB_SHA` - for reasons of completeness. | `ffac537e6cbbf934b08745a378932722df287a53` |
| `CI_PR_SHA_SHORT` | The shortened latest commit SHA in the pull request's base branch. Short version of `CI_PR_SHA`. Only set for pull requests. | `010b249` |
| `CI_PR_SHA` | The latest commit SHA in the pull request's base branch. Long version of `CI_PR_SHA_SHORT`. Only set for pull requests. | `010b2491902d50e8623934f5bc43763ff5991642` |
| `CI_PR_NUMBER` | The number of the pull request. Only set for pull requests. | `42` |
| `CI_PR_ID` | Copy of `CI_PR_NUMBER` for completeness. | `42` |
| `CI_PR_TITLE` | The title of the pull request. Only set for pull requests. | `Add feature xyz.` |
| `CI_PR_DESCRIPTION` | The description of the pull request. Only set for pull requests. | `The feature xyz is the [...]` |
| `CI_ACTOR` | The name of the person or app that initiated the workflow. Copy of `GITHUB_ACTOR` - for reasons of completeness. | `octocat` |
Expand Down Expand Up @@ -84,6 +88,12 @@ steps:
echo "CI_BASE_REF=$CI_BASE_REF"
echo "CI_SHA_SHORT=$CI_SHA_SHORT"
echo "CI_SHA=$CI_SHA"
echo "CI_PR_SHA_SHORT=$CI_PR_SHA_SHORT"
echo "CI_PR_SHA=$CI_PR_SHA"
echo "CI_PR_NUMBER=$CI_PR_NUMBER"
echo "CI_PR_ID=$CI_PR_ID"
echo "CI_PR_TITLE=$CI_PR_TITLE"
echo "CI_PR_DESCRIPTION=$CI_PR_DESCRIPTION"
echo "CI_ACTOR=$CI_ACTOR"
echo "CI_EVENT_NAME=$CI_EVENT_NAME"
echo "CI_RUN_ID=$CI_RUN_ID"
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'GitHub Environment Variables Action'
description: 'Expose useful Environment Variables.'
author: 'Franz Diebold'
runs:
using: 'node12'
using: 'node16'
main: 'dist/index.js'
branding:
icon: 'plus-circle'
Expand Down