Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

In pipeline ,how to skip test process?

ibigitadmin
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 23, 2024

in pipeline any possibility to skip the test process , if possible give example 

2 answers

0 votes
Francois Achache January 24, 2025

```yml

  steps:
    - step: &test
       name: Test
       script:
           - |
             # Get the last commit message
             LAST_COMMIT_MESSAGE=$(git log -1 --pretty=%B)
             # Check if last message contains "skip-tests"
             if [[ "$LAST_COMMIT_MESSAGE" == *"skip-tests"* ]]; then
                echo "Skipping tests due to commit message."
             else
                echo "Your commands for launch test here"
             fi

```

Include skip-tests in your git comment commit will cancel the step test

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 24, 2025

Thank you for the answer, Francois.

@ibigitadmin, if you want to skip the whole build and not a specific step of a certain build, you can include [skip ci] or [ci skip] in the commit message of a branch's last commit. In this case, the build won't get triggered when you push the commits to the branch:

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 24, 2024

Hi @ibigitadmin and welcome to the community!

If you are referring to sequential steps of a certain pipeline, then I'm afraid it is not possible to skip a pipelines step at the moment.

We have a feature request about this in our issue tracker:

The first pinned comment in that feature request is from one of the product managers, who mentioned that we plan to deliver this capability in the next 3 to 4 months.

You can add yourself as a watcher in that feature request (by selecting the link Start watching this issue in that ticket) if you'd like to get notified via email on further updates.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin Site Admin
TAGS
AUG Leaders

Atlassian Community Events