Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into users/cory-miller/git…
Browse files Browse the repository at this point in the history
…-user-and-email
  • Loading branch information
cory-miller committed Apr 25, 2024
2 parents c7e6c86 + 8459bc0 commit 5dac6c7
Show file tree
Hide file tree
Showing 107 changed files with 41,510 additions and 68,182 deletions.
20 changes: 20 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
version: 2

updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
groups:
minor-npm-dependencies:
# NPM: Only group minor and patch updates (we want to carefully review major updates)
update-types: [minor, patch]
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
minor-actions-dependencies:
# GitHub Actions: Only group minor and patch updates (we want to carefully review major updates)
update-types: [minor, patch]
8 changes: 4 additions & 4 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set Node.js 16.x
uses: actions/setup-node@v1
- name: Set Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: 20.x

- name: Install dependencies
run: npm ci
Expand All @@ -44,7 +44,7 @@ jobs:
fi
# If dist/ was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -55,4 +55,4 @@ jobs:
- run: rm -rf dist # We want code scanning to analyze lib instead (individual .js files)

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v3
64 changes: 58 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@ on:
- main
- releases/*


# Note that when you see patterns like "ref: test-data/v2/basic" within this workflow,
# these refer to "test-data" branches on this actions/checkout repo.
# (For example, test-data/v2/basic -> https://github.com/actions/checkout/tree/test-data/v2/basic)

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
- uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: 20.x
- uses: actions/checkout@v3
- run: npm ci
- run: npm run build
Expand All @@ -32,7 +37,7 @@ jobs:
steps:
# Clone this repo
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4.1.1

# Basic checkout
- name: Checkout basic
Expand Down Expand Up @@ -72,6 +77,53 @@ jobs:
shell: bash
run: __test__/verify-side-by-side.sh

# Filter
- name: Fetch filter
uses: ./
with:
filter: 'blob:none'
path: fetch-filter

- name: Verify fetch filter
run: __test__/verify-fetch-filter.sh

# Sparse checkout
- name: Sparse checkout
uses: ./
with:
sparse-checkout: |
__test__
.github
dist
path: sparse-checkout

- name: Verify sparse checkout
run: __test__/verify-sparse-checkout.sh

# Disabled sparse checkout in existing checkout
- name: Disabled sparse checkout
uses: ./
with:
path: sparse-checkout

- name: Verify disabled sparse checkout
shell: bash
run: set -x && ls -l sparse-checkout/src/git-command-manager.ts

# Sparse checkout (non-cone mode)
- name: Sparse checkout (non-cone mode)
uses: ./
with:
sparse-checkout: |
/__test__/
/.github/
/dist/
sparse-checkout-cone-mode: false
path: sparse-checkout-non-cone-mode

- name: Verify sparse checkout (non-cone mode)
run: __test__/verify-sparse-checkout-non-cone-mode.sh

# LFS
- name: Checkout LFS
uses: ./
Expand Down Expand Up @@ -138,7 +190,7 @@ jobs:
test-proxy:
runs-on: ubuntu-latest
container:
image: alpine/git:latest
image: ghcr.io/actions/test-ubuntu-git:main.20240221.114913.703z
options: --dns 127.0.0.1
services:
squid-proxy:
Expand Down Expand Up @@ -205,7 +257,7 @@ jobs:
path: basic
- name: Verify basic
run: __test__/verify-basic.sh --archive

test-git-container:
runs-on: ubuntu-latest
container: bitnami/git:latest
Expand Down Expand Up @@ -242,4 +294,4 @@ jobs:
- name: Fix Checkout v3
uses: actions/checkout@v3
with:
path: v3
path: v3
17 changes: 11 additions & 6 deletions .github/workflows/update-main-version.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,35 @@
name: Update Main Version
run-name: Move ${{ github.event.inputs.main_version }} to ${{ github.event.inputs.target }}
run-name: Move ${{ github.event.inputs.major_version }} to ${{ github.event.inputs.target }}

on:
workflow_dispatch:
inputs:
target:
description: The tag or reference to use
required: true
main_version:
major_version:
type: choice
description: The main version to update
description: The major version to update
options:
- v4
- v3
- v2

jobs:
tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Note this update workflow can also be used as a rollback tool.
# For that reason, it's best to pin `actions/checkout` to a known, stable version
# (typically, about two releases back).
- uses: actions/checkout@v4.1.1
with:
fetch-depth: 0
- name: Git config
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Tag new target
run: git tag -f ${{ github.event.inputs.main_version }} ${{ github.event.inputs.target }}
run: git tag -f ${{ github.event.inputs.major_version }} ${{ github.event.inputs.target }}
- name: Push new tag
run: git push origin ${{ github.event.inputs.main_version }} --force
run: git push origin ${{ github.event.inputs.major_version }} --force
59 changes: 59 additions & 0 deletions .github/workflows/update-test-ubuntu-git.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Publish test-ubuntu-git Container

on:
# Use an on demand workflow trigger.
# (Forked copies of actions/checkout won't have permission to update GHCR.io/actions,
# so avoid trigger events that run automatically.)
workflow_dispatch:
inputs:
publish:
description: 'Publish to ghcr.io? (main branch only)'
type: boolean
required: true
default: false

env:
REGISTRY: ghcr.io
IMAGE_NAME: actions/test-ubuntu-git

jobs:
build-and-push-image:
runs-on: ubuntu-latest
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Use `docker/login-action` to log in to GHCR.io.
# Once published, the packages are scoped to the account defined here.
- name: Log in to the ghcr.io container registry
uses: docker/login-action@v3.1.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Format Timestamp
id: timestamp
# Use `date` with a custom format to achieve the key=value format GITHUB_OUTPUT expects.
run: date -u "+now=%Y%m%d.%H%M%S.%3NZ" >> "$GITHUB_OUTPUT"

- name: Issue Image Publish Warning
if: ${{ inputs.publish && github.ref_name != 'main' }}
run: echo "::warning::test-ubuntu-git images can only be published from the actions/checkout 'main' branch. Workflow will continue with push/publish disabled."

# Use `docker/build-push-action` to build (and optionally publish) the image.
- name: Build Docker Image (with optional Push)
uses: docker/build-push-action@v5.3.0
with:
context: .
file: images/test-ubuntu-git.Dockerfile
# For now, attempts to push to ghcr.io must target the `main` branch.
# In the future, consider also allowing attempts from `releases/*` branches.
push: ${{ inputs.publish && github.ref_name == 'main' }}
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}.${{ steps.timestamp.outputs.now }}
2 changes: 1 addition & 1 deletion .licenses/npm/@actions/core.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions .licenses/npm/@actions/exec.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 10 additions & 20 deletions .licenses/npm/@actions/github.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 0 additions & 32 deletions .licenses/npm/@actions/http-client-1.0.8.dep.yml

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .licenses/npm/@actions/io.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5dac6c7

Please sign in to comment.