Skip to content

Commit

Permalink
Merge branch 'KelvinTegelaar:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
helixsystems1 authored Feb 17, 2025
2 parents 4980fe9 + 25dc5ac commit 038793f
Show file tree
Hide file tree
Showing 934 changed files with 100,799 additions and 19,328 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
local.settings.json
62 changes: 62 additions & 0 deletions .github/workflows/PR_Branch_Check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: PR Branch Check

on:
# Using pull_request_target instead of pull_request for secure handling of fork PRs
pull_request_target:
# Only run on these PR events
types: [opened, synchronize, reopened]
# Only check PRs targeting these branches
branches:
- main
- master

permissions:
pull-requests: write
issues: write

jobs:
check-branch:
runs-on: ubuntu-latest
steps:
- name: Check and Comment on PR
# Only process fork PRs with specific branch conditions
# Must be a fork AND (source is main/master OR target is main/master)
if: |
github.event.pull_request.head.repo.fork == true &&
((github.event.pull_request.head.ref == 'main' || github.event.pull_request.head.ref == 'master') ||
(github.event.pull_request.base.ref == 'main' || github.event.pull_request.base.ref == 'master'))
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
let message = '';
message += '🔄 If you are attempting to update your CIPP repo please follow the instructions at: https://docs.cipp.app/setup/self-hosting-guide/updating ';
message += '\n\n';
// Check if PR is targeting main/master
if (context.payload.pull_request.base.ref === 'main' || context.payload.pull_request.base.ref === 'master') {
message += '⚠️ PRs cannot target the main branch directly. If you are attempting to contribute code please PR to the dev branch.\n\n';
}
// Check if PR is from a fork's main/master branch
if (context.payload.pull_request.head.repo.fork &&
(context.payload.pull_request.head.ref === 'main' || context.payload.pull_request.head.ref === 'master')) {
message += '⚠️ This PR cannot be merged because it originates from your fork\'s main/master branch. If you are attempting to contribute code please PR from your dev branch or another non-main/master branch.\n\n';
}
message += '🔒 This PR will now be automatically closed due to the above violation(s).';
// Post the comment
await github.rest.issues.createComment({
...context.repo,
issue_number: context.issue.number,
body: message
});
// Close the PR
await github.rest.pulls.update({
...context.repo,
pull_number: context.issue.number,
state: 'closed'
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build and deploy Powershell project to Azure Function App - cipp4i6t3
name: Build and deploy Powershell project to Azure Function App - cipp44thq

on:
push:
Expand All @@ -24,7 +24,7 @@ jobs:
uses: Azure/functions-action@v1
id: fa
with:
app-name: 'cipp4i6t3'
app-name: 'cipp44thq'
slot-name: 'Production'
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_9D257A31ACA24925A112AF5FFC2BEAFE }}
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_2EBCA6FEB5E54403AE417859C5D28817 }}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build and deploy Powershell project to Azure Function App - cippkkxvm
name: Build and deploy Powershell project to Azure Function App - cippbcaom

on:
push:
Expand All @@ -24,7 +24,7 @@ jobs:
uses: Azure/functions-action@v1
id: fa
with:
app-name: 'cippkkxvm'
app-name: 'cippbcaom'
slot-name: 'Production'
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_171C3E2B1E2346AAA333905DFCA62F2D }}
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_0FE8CACBBF7D409DAAF132988BECEC4B }}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build and deploy Powershell project to Azure Function App - cipplwwww-proc
name: Build and deploy Powershell project to Azure Function App - cippjta72-proc

on:
push:
Expand All @@ -24,7 +24,7 @@ jobs:
uses: Azure/functions-action@v1
id: fa
with:
app-name: 'cipplwwww-proc'
app-name: 'cippjta72-proc'
slot-name: 'Production'
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_B8CE64E970E74E6AB2D6655823D95B1A }}
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_A53AC5C52A55459DA0A3D8F1716638CB }}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build and deploy Powershell project to Azure Function App - cipplwwww
name: Build and deploy Powershell project to Azure Function App - cippjta72

on:
push:
Expand All @@ -24,7 +24,7 @@ jobs:
uses: Azure/functions-action@v1
id: fa
with:
app-name: 'cipplwwww'
app-name: 'cippjta72'
slot-name: 'Production'
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_00A9A6DFE9244C2EA8952190FFF10F45 }}
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_5B44448119C645C099EE192346D7433A }}
30 changes: 0 additions & 30 deletions .github/workflows/dev_cippkwn4s-auditlog.yml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/dev_cippkwn4s.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/dev_cipppwrro.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build and deploy Powershell project to Azure Function App - cipppwrro

on:
push:
branches:
- dev
workflow_dispatch:

env:
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root

jobs:
deploy:
runs-on: windows-latest

steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v4

- name: 'Run Azure Functions Action'
uses: Azure/functions-action@v1
id: fa
with:
app-name: 'cipppwrro'
slot-name: 'Production'
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_D5D7DFF930C04B519206F25DDCD88324 }}
93 changes: 93 additions & 0 deletions .github/workflows/publish_prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Generate Release Notes and Upload

on:
push:
branches:
- pre-release

permissions:
contents: write

jobs:
release:
if: github.event.repository.fork == false && github.event_name == 'push'
name: Generate Release Notes and Upload to Azure
runs-on: ubuntu-latest

steps:
# Checkout the repository
- name: Checkout Code
uses: actions/checkout@v3

# Read and Trim Version
- name: Read and Trim Version
id: get_version
run: |
if [ ! -f version_latest.txt ]; then
echo "Error: version_latest.txt not found!"
exit 1
fi
VERSION=$(cat version_latest.txt | tr -d '[:space:]')
if [ -z "$VERSION" ]; then
echo "Error: version_latest.txt is empty after trimming!"
exit 1
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
# Exit if Tag Already Exists
- name: Check if Tag Exists
id: tag_check
run: |
git fetch --tags
if git rev-parse "refs/tags/${{ steps.get_version.outputs.version }}" >/dev/null 2>&1; then
echo "tag_exists=true" >> $GITHUB_ENV
echo "Tag ${{ steps.get_version.outputs.version }} already exists. Exiting workflow successfully."
else
echo "tag_exists=false" >> $GITHUB_ENV
fi
# Generate Release Notes
- name: Generate Release Notes
id: changelog
if: env.tag_exists == 'false'
uses: mikepenz/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Create a new release tag
- name: Create GitHub Release
if: env.tag_exists == 'false'
uses: ncipollo/[email protected]
with:
tag: ${{ steps.get_version.outputs.version }}
name: "v${{ steps.get_version.outputs.version }}"
draft: false
prerelease: true
body: ${{ steps.changelog.outputs.changelog }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Create ZIP File in a New Source Directory
- name: Prepare and Zip Release Files
if: env.tag_exists == 'false'
run: |
mkdir -p src/releases
zip -r src/releases/release_${{ steps.get_version.outputs.version }}.zip . \
--exclude "./src/releases/*" \
--exclude ".*" \
--exclude ".*/**"
zip -r src/releases/beta.zip . \
--exclude "./src/releases/*" \
--exclude ".*" \
--exclude ".*/**"
# Upload to Azure Blob Storage
- name: Azure Blob Upload with Destination folder defined
if: env.tag_exists == 'false'
uses: LanceMcCarthy/[email protected]
with:
connection_string: ${{ secrets.AZURE_CONNECTION_STRING }}
container_name: cipp-api
source_folder: src/releases/
destination_folder: /
delete_if_exists: true
Loading

0 comments on commit 038793f

Please sign in to comment.