mirror of
https://github.com/actions/checkout.git
synced 2025-06-09 11:22:39 +08:00
Compare commits
4 Commits
594b527b5e
...
750f2eebee
Author | SHA1 | Date | |
---|---|---|---|
|
750f2eebee | ||
|
11bd71901b | ||
|
e3d2460bbb | ||
|
9f4856a969 |
47
.github/workflows/defender-for-devops.yml
vendored
Normal file
47
.github/workflows/defender-for-devops.yml
vendored
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
# This workflow uses actions that are not certified by GitHub.
|
||||||
|
# They are provided by a third-party and are governed by
|
||||||
|
# separate terms of service, privacy policy, and support
|
||||||
|
# documentation.
|
||||||
|
#
|
||||||
|
# Microsoft Security DevOps (MSDO) is a command line application which integrates static analysis tools into the development cycle.
|
||||||
|
# MSDO installs, configures and runs the latest versions of static analysis tools
|
||||||
|
# (including, but not limited to, SDL/security and compliance tools).
|
||||||
|
#
|
||||||
|
# The Microsoft Security DevOps action is currently in beta and runs on the windows-latest queue,
|
||||||
|
# as well as Windows self hosted agents. ubuntu-latest support coming soon.
|
||||||
|
#
|
||||||
|
# For more information about the action , check out https://github.com/microsoft/security-devops-action
|
||||||
|
#
|
||||||
|
# Please note this workflow do not integrate your GitHub Org with Microsoft Defender For DevOps. You have to create an integration
|
||||||
|
# and provide permission before this can report data back to azure.
|
||||||
|
# Read the official documentation here : https://learn.microsoft.com/en-us/azure/defender-for-cloud/quickstart-onboard-github
|
||||||
|
|
||||||
|
name: "Microsoft Defender For Devops"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "main" ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ "main" ]
|
||||||
|
schedule:
|
||||||
|
- cron: '41 19 * * 2'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
MSDO:
|
||||||
|
# currently only windows latest is supported
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-dotnet@v4
|
||||||
|
with:
|
||||||
|
dotnet-version: |
|
||||||
|
5.0.x
|
||||||
|
6.0.x
|
||||||
|
- name: Run Microsoft Security DevOps
|
||||||
|
uses: microsoft/security-devops-action@v1.6.0
|
||||||
|
id: msdo
|
||||||
|
- name: Upload results to Security tab
|
||||||
|
uses: github/codeql-action/upload-sarif@v3
|
||||||
|
with:
|
||||||
|
sarif_file: ${{ steps.msdo.outputs.sarifFile }}
|
@ -1,5 +1,9 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v4.2.2
|
||||||
|
* `url-helper.ts` now leverages well-known environment variables by @jww3 in https://github.com/actions/checkout/pull/1941
|
||||||
|
* Expand unit test coverage for `isGhes` by @jww3 in https://github.com/actions/checkout/pull/1946
|
||||||
|
|
||||||
## v4.2.1
|
## v4.2.1
|
||||||
* Check out other refs/* by commit if provided, fall back to ref by @orhantoy in https://github.com/actions/checkout/pull/1924
|
* Check out other refs/* by commit if provided, fall back to ref by @orhantoy in https://github.com/actions/checkout/pull/1924
|
||||||
|
|
||||||
|
@ -24,13 +24,50 @@ describe('getServerUrl tests', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
describe('isGhes tests', () => {
|
describe('isGhes tests', () => {
|
||||||
|
const pristineEnv = process.env
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
jest.resetModules()
|
||||||
|
process.env = {...pristineEnv}
|
||||||
|
})
|
||||||
|
|
||||||
|
afterAll(() => {
|
||||||
|
process.env = pristineEnv
|
||||||
|
})
|
||||||
|
|
||||||
it('basics', async () => {
|
it('basics', async () => {
|
||||||
|
delete process.env['GITHUB_SERVER_URL']
|
||||||
expect(urlHelper.isGhes()).toBeFalsy()
|
expect(urlHelper.isGhes()).toBeFalsy()
|
||||||
expect(urlHelper.isGhes('https://github.com')).toBeFalsy()
|
expect(urlHelper.isGhes('https://github.com')).toBeFalsy()
|
||||||
expect(urlHelper.isGhes('https://contoso.ghe.com')).toBeFalsy()
|
expect(urlHelper.isGhes('https://contoso.ghe.com')).toBeFalsy()
|
||||||
expect(urlHelper.isGhes('https://test.github.localhost')).toBeFalsy()
|
expect(urlHelper.isGhes('https://test.github.localhost')).toBeFalsy()
|
||||||
expect(urlHelper.isGhes('https://src.onpremise.fabrikam.com')).toBeTruthy()
|
expect(urlHelper.isGhes('https://src.onpremise.fabrikam.com')).toBeTruthy()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('returns false when the GITHUB_SERVER_URL environment variable is not defined', async () => {
|
||||||
|
delete process.env['GITHUB_SERVER_URL']
|
||||||
|
expect(urlHelper.isGhes()).toBeFalsy()
|
||||||
|
})
|
||||||
|
|
||||||
|
it('returns false when the GITHUB_SERVER_URL environment variable is set to github.com', async () => {
|
||||||
|
process.env['GITHUB_SERVER_URL'] = 'https://github.com'
|
||||||
|
expect(urlHelper.isGhes()).toBeFalsy()
|
||||||
|
})
|
||||||
|
|
||||||
|
it('returns false when the GITHUB_SERVER_URL environment variable is set to a GitHub Enterprise Cloud-style URL', async () => {
|
||||||
|
process.env['GITHUB_SERVER_URL'] = 'https://contoso.ghe.com'
|
||||||
|
expect(urlHelper.isGhes()).toBeFalsy()
|
||||||
|
})
|
||||||
|
|
||||||
|
it('returns false when the GITHUB_SERVER_URL environment variable has a .localhost suffix', async () => {
|
||||||
|
process.env['GITHUB_SERVER_URL'] = 'https://mock-github.localhost'
|
||||||
|
expect(urlHelper.isGhes()).toBeFalsy()
|
||||||
|
})
|
||||||
|
|
||||||
|
it('returns true when the GITHUB_SERVER_URL environment variable is set to some other URL', async () => {
|
||||||
|
process.env['GITHUB_SERVER_URL'] = 'https://src.onpremise.fabrikam.com'
|
||||||
|
expect(urlHelper.isGhes()).toBeTruthy()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('getServerApiUrl tests', () => {
|
describe('getServerApiUrl tests', () => {
|
||||||
|
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "checkout",
|
"name": "checkout",
|
||||||
"version": "4.2.1",
|
"version": "4.2.2",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "checkout",
|
"name": "checkout",
|
||||||
"version": "4.2.1",
|
"version": "4.2.2",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.10.1",
|
"@actions/core": "^1.10.1",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "checkout",
|
"name": "checkout",
|
||||||
"version": "4.2.1",
|
"version": "4.2.2",
|
||||||
"description": "checkout action",
|
"description": "checkout action",
|
||||||
"main": "lib/main.js",
|
"main": "lib/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user