Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
1b0793cc05 Bump the minor-actions-dependencies group across 1 directory with 2 updates
Bumps the minor-actions-dependencies group with 2 updates in the / directory: [actions/publish-immutable-action](https://github.com/actions/publish-immutable-action) and [docker/build-push-action](https://github.com/docker/build-push-action).


Updates `actions/publish-immutable-action` from 0.0.3 to 0.0.4
- [Release notes](https://github.com/actions/publish-immutable-action/releases)
- [Commits](https://github.com/actions/publish-immutable-action/compare/0.0.3...v0.0.4)

Updates `docker/build-push-action` from 6.5.0 to 6.10.0
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v6.5.0...v6.10.0)

---
updated-dependencies:
- dependency-name: actions/publish-immutable-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-actions-dependencies
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-02 16:59:45 +00:00
9 changed files with 9 additions and 50 deletions

View File

@@ -17,4 +17,4 @@ jobs:
uses: actions/checkout@v4
- name: Publish
id: publish
uses: actions/publish-immutable-action@0.0.3
uses: actions/publish-immutable-action@v0.0.4

View File

@@ -48,7 +48,7 @@ jobs:
# Use `docker/build-push-action` to build (and optionally publish) the image.
- name: Build Docker Image (with optional Push)
uses: docker/build-push-action@v6.5.0
uses: docker/build-push-action@v6.10.0
with:
context: .
file: images/test-ubuntu-git.Dockerfile

View File

@@ -126,10 +126,6 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/
# running from unless specified. Example URLs are https://github.com or
# https://my-ghes-server.example.com
github-server-url: ''
# Set Git object format to "sha256" when initializing a Git repository.
# Default: false
repo-sha256: ''
```
<!-- end usage -->
@@ -315,17 +311,8 @@ jobs:
git commit -m "generated"
git push
```
*NOTE:* The user email is `{user.id}+{user.login}@users.noreply.github.com`. See users API: https://api.github.com/users/github-actions%5Bbot%5D
# Recommended permissions
When using the `checkout` action in your GitHub Actions workflow, it is recommended to set the following `GITHUB_TOKEN` permissions to ensure proper functionality, unless alternative auth is provided via the `token` or `ssh-key` inputs:
```yaml
permissions:
contents: read
```
# License

View File

@@ -98,10 +98,6 @@ inputs:
github-server-url:
description: The base URL for the GitHub instance that you are trying to clone from, will use environment defaults to fetch from the same instance that the workflow is running from unless specified. Example URLs are https://github.com or https://my-ghes-server.example.com
required: false
repo-sha256:
description: 'Set Git object format to "sha256" when initializing a Git repository.'
required: false
default: false
outputs:
ref:
description: 'The branch, tag or SHA that was checked out'

15
dist/index.js vendored
View File

@@ -709,14 +709,9 @@ class GitCommandManager {
getWorkingDirectory() {
return this.workingDirectory;
}
init(repoSHA256) {
init() {
return __awaiter(this, void 0, void 0, function* () {
const args = ['init'];
if (repoSHA256) {
args.push(`--object-format=sha256`);
}
args.push(this.workingDirectory);
yield this.execGit(args);
yield this.execGit(['init', this.workingDirectory]);
});
}
isDetached() {
@@ -1241,7 +1236,7 @@ function getSource(settings) {
// Initialize the repository
if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
core.startGroup('Initializing the repository');
yield git.init(settings.repoSHA256);
yield git.init();
yield git.remoteAdd('origin', repositoryUrl);
core.endGroup();
}
@@ -1836,10 +1831,6 @@ function getInputs() {
// Determine the GitHub URL that the repository is being hosted from
result.githubServerUrl = core.getInput('github-server-url');
core.debug(`GitHub Host URL = ${result.githubServerUrl}`);
// Set Git object format to "sha256" when initializing a Git repository.
result.repoSHA256 =
(core.getInput('repo-sha256') || 'false').toUpperCase() === 'TRUE';
core.debug(`Repo object format sha256 = ${result.repoSHA256}`);
return result;
});
}

View File

@@ -42,7 +42,7 @@ export interface IGitCommandManager {
): Promise<void>
getDefaultBranch(repositoryUrl: string): Promise<string>
getWorkingDirectory(): string
init(repoSHA256?: boolean): Promise<void>
init(): Promise<void>
isDetached(): Promise<boolean>
lfsFetch(ref: string): Promise<void>
lfsInstall(): Promise<void>
@@ -327,13 +327,8 @@ class GitCommandManager {
return this.workingDirectory
}
async init(repoSHA256?: boolean): Promise<void> {
const args = ['init']
if (repoSHA256) {
args.push(`--object-format=sha256`)
}
args.push(this.workingDirectory)
await this.execGit(args)
async init(): Promise<void> {
await this.execGit(['init', this.workingDirectory])
}
async isDetached(): Promise<boolean> {

View File

@@ -110,7 +110,7 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))
) {
core.startGroup('Initializing the repository')
await git.init(settings.repoSHA256)
await git.init()
await git.remoteAdd('origin', repositoryUrl)
core.endGroup()
}

View File

@@ -118,9 +118,4 @@ export interface IGitSourceSettings {
* User override on the GitHub Server/Host URL that hosts the repository to be cloned
*/
githubServerUrl: string | undefined
/**
* Set Git object format to "sha256" when initializing a Git repository
*/
repoSHA256: boolean
}

View File

@@ -161,10 +161,5 @@ export async function getInputs(): Promise<IGitSourceSettings> {
result.githubServerUrl = core.getInput('github-server-url')
core.debug(`GitHub Host URL = ${result.githubServerUrl}`)
// Set Git object format to "sha256" when initializing a Git repository.
result.repoSHA256 =
(core.getInput('repo-sha256') || 'false').toUpperCase() === 'TRUE'
core.debug(`Repo object format sha256 = ${result.repoSHA256}`)
return result
}