Skip to content

Commit 0fb03fa

Browse files
updates for ga (#46)
* updates for ga * Update README.md * Add detailed plugin docs * Remove ghcr credentials from cli --------- Co-authored-by: Ethan Dennis <erdennis13@gmail.com> Co-authored-by: Ethan Dennis <ethanis@github.com>
1 parent 627564a commit 0fb03fa

File tree

363 files changed

+17073
-394
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

363 files changed

+17073
-394
lines changed

CONTRIBUTING.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@ Please note that this project is released with a [Contributor Code of Conduct](C
88

99
Here's some helpful notes on how to contribute to this project, including details on how to get started working the codebase.
1010

11-
## How to submit a bug or request a feature
12-
13-
If you think you've found a bug or have a great idea for new functionality please create an issue in this repo.
14-
15-
## How to provide feedback or ask for help
16-
17-
Use the [Discussions](https://github.com/github/gh-actions-importer/discussions) tab in this repo for more general feedback or any questions/comments on this tooling.
18-
1911
## Configure your development environment
2012

2113
To get started, you'll need [.NET Core 6.0](https://dotnet.microsoft.com/en-us/download) installed on your local machine.
@@ -37,7 +29,3 @@ Code linting can be run using the following command:
3729
```bash
3830
$ dotnet format src/ActionsImporter.sln
3931
```
40-
41-
## Submitting a Pull Request
42-
43-
Before submitting a Pull Request please first open an issue to get feedback on the change you intend to submit.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 GitHub
3+
Copyright (c) 2023 GitHub
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 25 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,25 @@
22

33
[![.github/workflows/ci.yml](https://github.com/github/gh-actions-importer/actions/workflows/ci.yml/badge.svg)](https://github.com/github/gh-actions-importer/actions/workflows/ci.yml)
44

5-
[GitHub Actions Importer](https://docs.github.com/en/actions/migrating-to-github-actions/automating-migration-with-github-actions-importer) helps plan, forecast, and automate the migration of Azure DevOps, CircleCI, GitLab, Jenkins, and Travis CI pipelines to GitHub Actions. This repository provides functionality that extends the [GitHub CLI](https://cli.github.com/) to migrate pipelines using the GitHub Actions Importer.
6-
7-
> **Note**: Sign up [here](https://github.com/features/actions-importer/signup) to request access to the public preview for GitHub Actions Importer. Once you are granted access you'll be able to use the `gh-actions-importer` CLI extension
8-
9-
You can request support [here](https://support.github.com/contact?tags=actions_importer_beta) on a best-effort basis during the public preview period.
10-
11-
## Supported platforms
12-
13-
GitHub Actions Importer currently supports migrating pipelines to GitHub Actions from the following platforms:
5+
[GitHub Actions Importer](https://docs.github.com/en/actions/migrating-to-github-actions/automating-migration-with-github-actions-importer) helps plan, test, and automate your migration to GitHub Actions from the following platforms:
146

157
- Azure DevOps
168
- CircleCI
179
- GitLab
1810
- Jenkins
1911
- Travis CI
2012

21-
You can find detailed information about how the GitHub Actions Importer works for each of the supported platforms in the documentation that is available once you are granted access.
22-
23-
## Getting started with GitHub Actions Importer
13+
## Getting started
2414

2515
GitHub Actions Importer is distributed as a Docker container and this extension to the official [GitHub CLI](https://cli.github.com) to interact with the Docker container.
2616

2717
### Prerequisites
2818

2919
The following requirements must be met to be able to use the GitHub Actions Importer:
3020

31-
- The Docker CLI must be [installed](https://docs.docker.com/get-docker/) and running
32-
- The official [GitHub CLI](https://cli.github.com) must be installed
33-
- You must have credentials to [authenticate](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-to-the-container-registry) with the GitHub Container Registry after you are granted access.
21+
- The Docker CLI must be [installed](https://docs.docker.com/get-docker/) and running.
22+
- The official [GitHub CLI](https://cli.github.com) must be installed.
23+
- You must have credentials to [authenticate](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-to-the-container-registry) with the GitHub Container Registry.
3424

3525
### Installation
3626

@@ -40,26 +30,9 @@ Next, the GitHub Actions Importer CLI extension can be installed via this comman
4030
$ gh extension install github/gh-actions-importer
4131
```
4232

43-
To verify the extension is installed, run this command:
44-
45-
```bash
46-
$ gh actions-importer -h
47-
Options:
48-
-?, -h, --help Show help and usage information
49-
50-
Commands:
51-
update Update to the latest version of the GitHub Actions Importer.
52-
version Display the version of the GitHub Actions Importer.
53-
configure Start an interactive prompt to configure credentials used to authenticate with your CI server(s).
54-
audit Plan your CI/CD migration by analyzing your current CI/CD footprint.
55-
forecast Forecast GitHub Actions usage from historical pipeline utilization.
56-
dry-run Convert a pipeline to a GitHub Actions workflow and output its yaml file.
57-
migrate Convert a pipeline to a GitHub Actions workflow and open a pull request with the changes.
58-
```
59-
6033
### Configuration
6134

62-
New versions of the GitHub Actions Importer are released on a regular basis. To ensure you're always up to date, the following command should be run often:
35+
New versions of the GitHub Actions Importer are released on a regular basis. To ensure you're up to date, run the following command:
6336

6437
```bash
6538
$ gh actions-importer update
@@ -71,109 +44,40 @@ $ gh actions-importer update
7144
$ echo $GITHUB_TOKEN | gh actions-importer update --username $GITHUB_HANDLE --password-stdin
7245
```
7346

74-
In order for the GitHub Actions Importer to communicate with your current CI/CD server and GitHub, various credentials must be available for the command. These can be configured using environment variables or a `.env.local` file. These environment variables can be configured in an interactive prompt by running the following command:
47+
In order for GitHub Actions Importer to communicate with your current CI/CD server and GitHub, various credentials must be available for the command. These can be configured using environment variables or a `.env.local` file. These environment variables can be configured in an interactive prompt by running the following command:
7548

7649
```bash
7750
$ gh actions-importer configure
7851
? Enter value for 'GITHUB_ACCESS_TOKEN' (leave empty to skip):
7952
...
8053
```
8154

82-
You can find detailed information about using environment variables in the documentation that is available once you are granted access.
83-
84-
### Usage
85-
86-
Now that the GitHub Actions Importer is configured and up-to-date, different subcommands of `gh actions-importer` can be used to migrate to GitHub Actions.
87-
88-
#### Audit
89-
90-
The `audit` subcommand can be used to plan your CI/CD migration by analyzing your current CI/CD footprint. This analysis can then be used to plan timelines for migrating to GitHub Actions.
91-
92-
To run an audit, use the following command to determine the options that are relevant to your use case:
93-
94-
```bash
95-
$ gh actions-importer audit -h
96-
Description:
97-
Plan your CI/CD migration by analyzing your current CI/CD footprint.
98-
99-
[...]
100-
101-
Commands:
102-
azure-devops An audit will output a list of data used in an Azure DevOps instance.
103-
circle-ci An audit will output a list of data used in a CircleCI instance.
104-
gitlab An audit will output a list of data used in a GitLab instance.
105-
jenkins An audit will output a list of data used in a Jenkins instance.
106-
travis-ci An audit will output a list of data used in a Travis CI instance.
107-
```
108-
109-
You can find detailed information about running an audit with the GitHub Actions Importer in the documentation that is available once you are granted access to the public preview.
110-
111-
#### Forecast
112-
113-
The `forecast` subcommand can be used to forecast GitHub Actions usage based on historical pipeline usage.
114-
115-
To run a forecast, use the following command to determine the options that are relevant to you:
55+
You can find detailed information about using environment variables in the platform-specific documentation.
11656

117-
```bash
118-
$ gh actions-importer forecast -h
119-
Description:
120-
Forecasts GitHub Actions usage from historical pipeline utilization.
121-
122-
[...]
123-
124-
Commands:
125-
azure-devops Forecasts GitHub Actions usage from historical Azure DevOps pipeline utilization.
126-
jenkins Forecasts GitHub Actions usage from historical Jenkins pipeline utilization.
127-
gitlab Forecasts GitHub Actions usage from historical GitLab pipeline utilization.
128-
circle-ci Forecasts GitHub Actions usage from historical CircleCI pipeline utilization.
129-
travis-ci Forecasts GitHub Actions usage from historical Travis CI pipeline utilization.
130-
github Forecasts GitHub Actions usage from historical GitHub pipeline utilization.
131-
```
57+
### Documentation
13258

133-
You can find detailed information about running a forecast with the GitHub Actions Importer in the documentation that is available once you are granted access to the public preview.
59+
Detailed information about how to use GitHub Actions Importer can be found in the [documentation](https://docs.github.com/en/actions/migrating-to-github-actions/automating-migration-with-github-actions-importer).
13460

135-
#### Dry run
61+
### Recordings
13662

137-
The `dry-run` subcommand can be used to convert a pipeline to its GitHub Actions equivalent and write the workflow to your local filesystem.
63+
You can access recorded demos of GitHub Actions Importer performing migrations to Actions from the following CI/CD platforms:
64+
- [Azure DevOps](https://youtu.be/gG-2bkmBRlI)
65+
- [CircleCI](https://youtu.be/YkFnNEyM9Hg)
66+
- [GitLab](https://youtu.be/3t5ywu0_qk4)
67+
- [Jenkins](https://youtu.be/WqiGP6h4fa0)
68+
- [Travis CI](https://youtu.be/ndc-FNa_X3c)
13869

139-
To run a dry run, use the following command to determine the options that are relevant to you:
70+
### Self-guided learning
14071

141-
```bash
142-
$ gh actions-importer dry-run -h
143-
Description:
144-
Convert a pipeline to a GitHub Actions workflow and output its yaml file.
145-
146-
[...]
147-
148-
Commands:
149-
azure-devops Convert an Azure DevOps pipeline to a GitHub Actions workflow and output its yaml file.
150-
circle-ci Convert a CircleCI pipeline to GitHub Actions workflows and output the yaml file(s).
151-
gitlab Convert a GitLab pipeline to a GitHub Actions workflow and output the yaml file.
152-
jenkins Convert a Jenkins job to a GitHub Actions workflow and output its yaml file.
153-
travis-ci Convert a Travis CI pipeline to a GitHub Actions workflow and output its yaml file.
154-
```
72+
The GitHub Actions Importer labs repository contains platform-specific learning paths that teach you how to use GitHub Actions Importer and how to approach migrations to GitHub Actions. To learn more, see the [GitHub Actions Importer labs repository](https://github.com/actions/importer-labs/tree/main#readme).
15573

156-
You can find detailed information about running a dry run with the GitHub Actions Importer in the documentation that is available once you are granted access to the public preview.
74+
## Product roadmap
15775

158-
#### Migrate
76+
To learn about new features coming to GitHub Actions Importer, see the [GitHub Public Roadmap](https://github.com/orgs/github/projects/4247).
15977

160-
The `migrate` subcommand can be used to convert a pipeline to its GitHub Actions equivalent and then create a pull request with the contents.
78+
## How to offer feedback or make a feature request
16179

162-
To run a migration, use the following command to determine the options that are relevant to your use case:
163-
164-
```bash
165-
$ gh actions-importer migrate -h
166-
Description:
167-
Convert a pipeline to a GitHub Actions workflow and open a pull request with the changes.
168-
169-
[...]
170-
171-
Commands:
172-
azure-devops Convert an Azure DevOps pipeline to a GitHub Actions workflow and open a pull request with the changes.
173-
circle-ci Convert a CircleCI pipeline to GitHub Actions workflows and open a pull request with the changes.
174-
gitlab Convert a GitLab pipeline to a GitHub Actions workflow and open a pull request with the changes.
175-
jenkins Convert a Jenkins job to a GitHub Actions workflow and open a pull request with the changes.
176-
travis-ci Convert a Travis CI pipeline to a GitHub Actions workflow and and open a pull request with the changes.
177-
```
80+
If you would like to offer feedback or make a feature request, please create a new discussion [here](https://github.com/github/gh-actions-importer/discussions/new/choose).
17881

179-
You can find detailed information about running a migration with the GitHub Actions Importer in the documentation that is available once you are granted access to the public preview.
82+
## How to request support
83+
If you need further assistance, you can file a support ticket [here](https://support.github.com).

docs/azure_devops/Ant.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Ant task
2+
3+
## Azure DevOps input
4+
5+
```yaml
6+
- task: Ant@1
7+
inputs:
8+
buildFile: 'build.xml' # Required, alias: antBuildFile
9+
options: -DmyProperty=myPropertyValue # Optional
10+
targets: build-test # Optional
11+
publishJUnitResults: true # Required
12+
testResultsFiles: '**/TEST-*.xml' # Required when publishJUnitResults == True
13+
testRunTitle: "Test Run Title" # Optional
14+
antHomeDirectory: ANT_HOME # Optional, alias: antHomeUserInputPath
15+
javaHomeOption: 'JDKVersion' # Options: jDKVersion, path, Alias: javaHomeSelection
16+
jdkVersionOption: 'default' # Optional. Options: default, 1.11, 1.10, 1.9, 1.8, 1.7, 1.6, Alias: jdkVersion
17+
jdkUserInputDirectory: # Required when javaHomeOption == Path, Alias: jdkUserInputPath
18+
jdkArchitectureOption: 'x64' # Optional. Options: x86, x64, Alias: jdkArchitecture
19+
```
20+
21+
### Transformed Github Action
22+
23+
```yaml
24+
- name: Set up JDK 1.11
25+
uses: actions/setup-java@v3.10.0
26+
with:
27+
java-version: '1.11'
28+
- run: ant -DmyProperty=myPropertyValue -buildfile build.xml build-test
29+
env:
30+
ANT_HOME: ANT_HOME_DIR
31+
- name: Publish test results
32+
uses: EnricoMi/publish-unit-test-result-action@v2.4.1
33+
if: always()
34+
with:
35+
comment_title: Test Run Title
36+
files: "**/TEST-*.xml"
37+
```
38+
39+
```yaml
40+
# publishJUnitResults: false
41+
- name: Set up JDK 1.11
42+
uses: actions/setup-java@v3.10.0
43+
with:
44+
java-version: '1.11'
45+
- run: ant -DmyProperty=myPropertyValue -buildfile build.xml build-test
46+
env:
47+
ANT_HOME: ANT_HOME_DIR
48+
```
49+
50+
### Unsupported inputs
51+
52+
- codeCoverageToolOptions, alias: codeCoverageTool
53+
- codeCoverageClassFilesDirectories, alias: classFilesDirectories
54+
- codeCoverageClassFilter, alias: classFilter
55+
- codeCoverageSourceDirectories, alias: srcDirectories
56+
- codeCoverageFailIfEmpty, alias: failIfCoverageEmpty

docs/azure_devops/ArchiveFiles.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# ArchiveFiles task
2+
3+
## Azure DevOps input
4+
5+
```yaml
6+
steps:
7+
- task: ArchiveFiles@2
8+
inputs:
9+
rootFolderOrFile: '$(Build.BinariesDirectory)' # Required, Default: $(Build.BinariesDirectory)
10+
includeRootFolder: true # Required
11+
archiveType: 'zip' # Required, Options: zip, 7z, tar, wim
12+
tarCompression: 'gz' # Optional, Options: gz, bz2, xz, None. Default: 'gz'
13+
sevenZipCompression: "9" # Default: 5
14+
archiveFile: 'archive_file' # Required, Default: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
15+
replaceExistingArchive: true # Required
16+
verbose: false # Optional
17+
quiet: false # Optional
18+
```
19+
20+
### Transformed Github Action
21+
22+
Note:
23+
24+
- incoming input for archive_file needs to specify extension type. It is not added in transformation.
25+
- Zip uses 7z compression
26+
27+
```yaml
28+
29+
- name: Tar files
30+
run: tar -cf archive_file $(Build.BinariesDirectory) --overwrite
31+
```
32+
33+
```yaml
34+
35+
- name: Zip files
36+
run: 7z u archive_file $(Build.BinariesDirectory)
37+
```
38+
39+
```yaml
40+
41+
- name: 7z files
42+
run: 7z u -mx=9 archive_file $(Build.BinariesDirectory)
43+
```
44+
45+
### Unsupported inputs
46+
47+
- archiveType (wim)
48+
- quiet
49+
- verbose (7z, zip)
50+
- sevenzipcompression (zip)
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Azure App Service Manage task
2+
3+
## Azure DevOps input
4+
5+
```yaml
6+
# Azure App Service manage
7+
# Start, stop, restart, slot swap, slot delete, install site extensions or enable continuous monitoring for an Azure App Service
8+
- task: AzureAppServiceManage@0
9+
inputs:
10+
azureSubscription: # Required, Alias: ConnectedServiceName
11+
action: 'Swap Slots' # Optional. Default: Swap Slots
12+
# Options: Swap Slots, Start Swap With Preview, Complete Swap, Cancel Swap, Start Azure App Service, Stop Azure App Service, Restart Azure App Service, Delete Slot, Install Extensions, Enable Continuous Monitoring, Start all continuous webjobs, Stop all continuous webjobs
13+
webAppName: "App Name" # Required
14+
specifySlotOrASE: false # Optional, Alias: SpecifySlot
15+
resourceGroupName: # Required when action == Swap Slots || Action == Delete Slot || SpecifySlot == True
16+
sourceSlot: # Required when action == Swap Slots
17+
swapWithProduction: true # Optional, Default: true
18+
targetSlot: # Required when action == Swap Slots && SwapWithProduction == False
19+
preserveVnet: false # Optional, Default: false
20+
slot: 'production' # Required when action == Delete Slot || SpecifySlot == True, Default: production
21+
# Unsupported
22+
extensionsList: # Required when action == Install Extensions
23+
outputVariable: # Optional
24+
appInsightsResourceGroupName: # Required when action == Enable Continuous Monitoring
25+
applicationInsightsResourceName: # Required when action == Enable Continuous Monitoring
26+
applicationInsightsWebTestName: # Optional
27+
```
28+
29+
### Transformed Github Action
30+
31+
```yaml
32+
- uses: Azure/login@v1
33+
with:
34+
creds: "${{ secrets.AZURE_CREDENTIALS }}"
35+
- uses: azure/cli@v1.0.7
36+
with:
37+
# Action - Start & Stop
38+
inlineScript: az webapp start --name "web-app" --resource-group "app-resource-group" --subscription "Azure Subscription"
39+
# Action - Delete Slot
40+
inlineScript: az webapp deployment slot delete --name "web-app" --resource-group "app-resource-group" --subscription "Azure Subscription" --slot "staging"
41+
# Action - Swap Slots, add action field for Start With Preview, Complete Swap, Cancel Swap
42+
inlineScript: az webapp deployment slot swap --name "web-app" --resource-group "app-resource-group" --subscription "Azure Subscription" --slot "staging" --target-slot "targetSlot" --preserve-vnet false --action {preview, swap, reset}
43+
# Start/Stop all continuous WebJobs
44+
inlineScript: |-
45+
WEB_JOBS="$(az webapp webjob continuous list --name "service-app" --resource-group "service-resource-group" --subscription "Azure Subscription" --query "[].name" --output tsv)"
46+
echo "$WEB_JOBS" | while read line ; do
47+
web_job_name="${line##*/}"
48+
az webapp webjob continuous start --name "service-app" --resource-group "service-resource-group" --subscription "Azure Subscription" --slot "slot-staging" --webjob-name "$web_job_name"
49+
done
50+
```
51+
52+
### Unsupported inputs
53+
54+
- Enable Continuous Monitoring(Action)
55+
- Install Extensions(Action)
56+
- ExtensionsList(Install Extensions)
57+
- OutputVariable(Install Extensions)
58+
- AppInsightsResourceGroupName(Enable Continuous Monitoring)
59+
- ApplicationInsightsResourceName(Enable Continuous Monitoring)
60+
- ApplicationInsightsWebTestName(Enable Continuous Monitoring)

0 commit comments

Comments
 (0)