![]() There are three scenarios that define how the command is built up Builds up a p4 command based on your inputs.Bad p4 commands, bad p4 arguments, bad p4 spec, and pipefail errors are all caught and will fail the GitHub Step to prevent false positives in your pipelines.stdout, stderr, and exit_code are captured for you and stored as GitHub Outputs.you don't have to worry about passing complex spec as stdin to the p4 command ( example).Take a look at setup-only.yml for an example of what this looks like.Īlternatively to running P4 CLI commands using the GitHub Actions run syntax you can use helpers that are provided by the setup-p4 action. This allows most P4 CLI commands to work exactly like they do on your local command line. HelpersĪfter running the setup routine, subsequent steps in the same job can run arbitrary P4 CLI commands using the GitHub Actions run syntax. uses: you will not get automatic security updates or new features without explicitly updating your version number. Note: Because workflows are visible to other users, you should use secrets to store sensitive information such as passwords. GitHub Actions allows you to set environment variables at multiple levels: The P4 CLI can utilize environment variables to get configuration and the same applies to p4 in GitHub Actions. All subsequent steps will be able to use the p4 found in the $PATH. In this step the it will check if the specified version is already present, if it is not it will be loaded, cached, and added to the $PATH. p4_version should only be specified in a setup GitHub Action Step. P4_version defines the version of the p4 binary that will be downloaded and cached. (See p4 client in quickstart.yml for an example.) p4_version In arguments include the option -i so that p4 reads from STDIN instead of opening your P4EDITOR. If spec is provided the contents of spec will be passed to the STDIN of the p4 command. Note that the specified directory must exist. The Action will change directory to what is provided in working_directory. To find available arguments first find the command documentation and then look under the Options section. P4USER by including -u joe in global_optionsĪrguments supports all P4 Command arguments.P4PORT by including -p ssl::1666 in global_options.Global_options supports all P4 global options.Ĭommon global_options you may want to set would include Spec content that is fed into p4 stdin to create/update resourcesĬommand supports all P4 CLI commands. P4 CLI global options that are supplied on the command line before the commandĪrguments specific to the P4 command being usedĭirectory to change into before running p4 command Review the quickstart.yml for an example workflow that: We will use these values later to connect to your Helix Core server. Start by creating GitHub Secrets for the following values. Connection details and credentials can be securely stored in the GitHub Action secrets.Optionally use GitHub Action Inputs to simplify setting up P4 CLI workflows.Adds p4 to PATH for easy access to P4 CLI.All P4 CLI commands can be run from the Action.Defaults to latest version of P4 CLI but can be set to a specific version.This Action supports all GitHub Hosted and Self-Hosted Runner Operating Systems.In addition, the Action includes the following features: ![]() The perforce/setup-p4 action is a JavaScript Action that sets up Perforce Helix Core P4 CLI in your GitHub Actions workflow, allowing you to easily create interactions between your repository and your Perforce server. GitHub Action for running Perforce Helix Core P4 CLI commands.
0 Comments
Leave a Reply. |